ModelOriented / ModelOriented/DALEX
Add support for Multiregression tasks
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
I tried the python version of dalex with a multiregression model and it gave an error. (See below)
Is there any way around it ?
If i understand correctly iBreakdown/pyBreakdown can deal with multiple classes for classification which are also probabilities organized in multiple columns/arrays so this should be quite similar. Would be great if this would be enabled.
The SHAP package also supports Shap values for the multirgression case.
Can i call ibreakdown directly from dalex, without generating an explainer object ? The ibreakdown for Python has not been updated in a while but the new Python Dalex seems quite active.
decision tree for multioutput regression
import dalex as dx
from sklearn.datasets import make_regression
from sklearn.tree import DecisionTreeRegressor
create datasets
X, y = make_regression(n_samples=1000, n_features=10, n_informative=5, n_targets=2, random_state=1, noise=0.5)
define model
model = DecisionTreeRegressor()
model.fit(X,y)
dx.Explainer(model,X,y)
data is converted to pd.DataFrame, columns are set as string numbers
-> data : 1000 rows 10 cols
Traceback (most recent call last):
File "", line 11, in
dx.Explainer(model,X,y)
File "C:\Users\Thomas Wolf\anaconda3\envs\my-rdkit-env\lib\site-packages\dalex_explainer\object.py", line 131, in init
y = check_y(y, data, verbose)
File "C:\Users\Thomas Wolf\anaconda3\envs\my-rdkit-env\lib\site-packages\dalex_explainer\checks.py", line 52, in check_y
raise ValueError("y must have only one dimension")
ValueError: y must have only one dimension
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the example with the Python DALEX Explainer, then inspect dalex/_explainer/checks.py and dalex/_explainer/object.py around the y dimensionality check shown in the traceback. Review the existing iBreakdown and classification handling before deciding the scope. Done means multiregression models are accepted and the relevant explanation paths work with multi-column targets, with tests covering the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, scikit-learn
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100