Can Autosklearn be used with SHAP?
See original GitHub issueCan the model be used with SHAP?
Currently
import shap
explainer = shap.Explainer(model)
results in
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-361-5c713ec694d6> in <module>
----> 1 explainer = shap.Explainer(model)
~/anaconda3/envs/python3/lib/python3.6/site-packages/shap/explainers/_explainer.py in __init__(self, model, masker, link, algorithm, output_names, feature_names, **kwargs)
145 # if we get here then we don't know how to handle what was given to us
146 else:
--> 147 raise Exception("The passed model is not callable and cannot be analyzed directly with the given masker! Model: " + str(model))
148
149 # build the right subclass
Exception: The passed model is not callable and cannot be analyzed directly with the given masker! Model: AutoSklearn2Classifier(delete_output_folder_after_terminate=False,
ensemble_size=1, memory_limit=7000, metric=f1, n_jobs=8,
output_folder='automl4_preds', per_run_time_limit=480,
time_left_for_this_task=600)
System Details (if relevant)
auto-sklearn
0.12.7
shap
0.38.1
Running on Linux?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
APIs — AutoSklearn 0.15.0 documentation
User-created dask client, can be used to start a dask cluster and then attach auto-sklearn ... List of str of len(X.shape[1]) describing the...
Read more >Auto-Sklearn: Accelerate your machine learning models with ...
The main approach in Auto-Sklearn is to limit the involvement of data scientists and let the tool handle all time-consuming processes.
Read more >Auto-Sklearn for Automated Machine Learning in Python
In this tutorial, you will discover how to use Auto-Sklearn for AutoML ... The example below downloads the dataset and summarizes its shape....
Read more >Auto-Sklearn: AutoML in Python - ODSC - Open Data Science
Instead of manually specifying a pipeline, we can just use the Auto-sklearn estimator object and all that's left is to decide how much ......
Read more >Complete Guide to Using AutoSklearn - Tool For Faster ...
Automated machine learning algorithms can be a huge time saver especially if the data is huge or the algorithm to be used is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can also find an example in this notebook: https://github.com/automl/auto-sklearn-talks/blob/main/2021_07_28_EuroPython/Tutorial-Regression.ipynb
Hi @roger-yu-ds,
Looking at
shap
source code forExplainer.__init__()
, it seems that it will not work out of the box as you have given.I would suggest using their model agnostic Explainer.
I would also advise updating
auto-sklearn
to14.0
as we fixed some issues with probability outputs in some scenarios. Hopefully it won’t matter but if you face issues with incorrect probability sizes, this should fix it.