Open apavlo89 opened 1 year ago
I have never tried! As long as they are sklearn compatible and work with shap it should work I guess!
If this is still of interest, I managed to make AutoGluon work with explainer dashboard. I used the most recent releases of both.
You need to wrap the model into a wrapper class that changes the predict_proba function, as the default result of Autogluon is different of what explainer dashboard expects:
import numpy as np
class AutoGluonWrapper:
def __init__(self, model) -> None:
self.__model = model
def predict(self, x, **kwargs):
self.__model.predict(x=x, **kwargs)
def predict_proba(self, x, **kwargs):
probabilities_raw = self.__model.predict_proba(x, **kwargs)
probabilities = np.array(probabilities_raw)
return probabilities
Then you can just call the dashboard using a training AutoGluon model:
dashboard = ExplainerDashboard(ClassifierExplainer(AutoGluonWrapper(model), X_test, y_test))
wait, so the issue is that predict_proba doesn't return an np.ndarray by default? That should be easy enough to wrap or detect inside the library
Indeed, that is the issue with this AutoML, most AutoML actually work out of the box or with a simple wrapper class similar to the one I posted above. In case a wrapper is needed, it is because the predict_proba returns something unexpected.
Is there a way to load autogluon models into explainer dashboard?