lime
lime copied to clipboard
Saving an Explainer
Is there a way to save an explainer object so it can be loaded later without needing to build it against the full dataset?
I've tried pickling it but it returns
explainer = lime.lime_tabular.LimeTabularExplainer( np.array(X), feature_names=X.columns, class_names=['x', 'y'], discretize_continuous=True)
with open('explainer.pkl', 'wb') as f:
pickle.dump( explainer , f, pickle.HIGHEST_PROTOCOL)
AttributeError Traceback (most recent call last)
<ipython-input-90-9e7a99eff9e4> in <module>()
1 with open('explainer.pkl', 'wb') as f:
----> 2 pickle.dump( explainer , f, pickle.HIGHEST_PROTOCOL)
AttributeError: Can't pickle local object 'BaseDiscretizer.__init__.<locals>.<lambda>'
use dill. See also #98, #61