Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Support for Regression Models #1

Closed
ombhojane opened this issue Sep 26, 2024 · 11 comments
Closed

Implement Support for Regression Models #1

ombhojane opened this issue Sep 26, 2024 · 11 comments

Comments

@ombhojane
Copy link
Owner

Currently, the explainableAI package only supports classification models. We need to extend its functionality to work with regression models as well.

@KunjShah95
Copy link
Contributor

kidnly assign it to me

@ombhojane
Copy link
Owner Author

@KunjShah95 go ahead!

@KunjShah95
Copy link
Contributor

not able to create pulll request so attaching the solution here

Extending ExplainableAI to Support Regression Models

To extend the ExplainableAI package to support regression models, we need to make the following changes:

1. Update the Model Interface

The current model interface is designed to work with classification models. We need to modify it to accommodate regression models. This can be done by adding a new method to the interface that returns the predicted values for regression models.

python

class ModelInterface:
def predict_proba(self, X):
# Returns the predicted probabilities for classification models
pass

def predict(self, X):
    # Returns the predicted values for regression models
    pass

2. Implement Regression Model Support

We need to update the existing implementation to support regression models. This involves modifying the explain method to handle regression models.

python

def explain(model, X, y, **kwargs):
if isinstance(model, RegressionModel):
# Handle regression models
pass
else:
# Handle classification models
pass

3. Add Regression Model Classes

We need to add new classes for regression models that implement the updated model interface.

python

class RegressionModel(ModelInterface):
def init(self, model):
self.model = model

def predict(self, X):
    # Returns the predicted values for regression models
    return self.model.predict(X)

4. Update the Explanation Algorithms

We need to update the explanation algorithms to support regression models. This involves modifying the algorithms to handle the predicted values returned by regression models.

python

def lime_explain(model, X, y, **kwargs):
if isinstance(model, RegressionModel):
# Handle regression models
pass
else:
# Handle classification models
pass

By making these changes, we can extend the ExplainableAI package to support regression models.

@ombhojane
Copy link
Owner Author

Hey, please try to make a PR along needed codes, it would be easier to me to assign labels and merge it!

@KunjShah95
Copy link
Contributor

tried doing it but issue is there so pr is not happening

@ombhojane
Copy link
Owner Author

might be this resources help you:
https://youtu.be/8lGpZkjnkt4?si=0C02rqByAALGJ8ed
https://youtu.be/OVQK2zzb6U8?si=YXSyDfNqa0wJ0zgZ

Or you can see contribution.md present in our codebase

@KunjShah95
Copy link
Contributor

i have pull requuest the fetaures u wanted to implement it in the code

@KunjShah95
Copy link
Contributor

kidnly check it

@alo7lika
Copy link
Contributor

alo7lika commented Oct 2, 2024

Assign me this Work. I would love to contribute.

@KunjShah95
Copy link
Contributor

i have already submitted the pr for it if u wish to contribute in it then u are welcome to do so

ombhojane added a commit that referenced this issue Oct 3, 2024
Implement Support for Regression Models #1
@KunjShah95
Copy link
Contributor

will i get hactober fest reward for completing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants