1

There are similar question, but nothing solve my problem. One thing I think that the last line of my code doesn't work in data bricks (where I am working). I am displaying part of the code which you actually can't reproduce, but it's probably small issue that might be solved without reproducing code. But if it's needed, I will update that.

Another thing I got that I can probably use

displayHTML("""<p>https://www.medium.com" </p>""")

But I couldn't figure out how to get the the link. The part of the code is below (I fit a classification model) and want to use lime package to interpret.

!pip install lime
import lime
from lime import lime_tabular

explainer = lime_tabular.LimeTabularExplainer(
    training_data=np.array(X_train),
    feature_names=X_train.columns,
    class_names=['Fail', 'No_Fail'],
    mode='classification'
)
exp = explainer.explain_instance(
    data_row=X_test.iloc[1], 
    predict_fn=lgbm_class.predict_proba
)
exp.show_in_notebook(show_table=True)

What can I try next?

1 Answer 1

1

Call to explainer.explain_instance returns an instance of the Explainer class, and this instance has the as_html function, so following theoretically should work:

exp = explainer.explain_instance(
    data_row=X_test.iloc[1], 
    predict_fn=lgbm_class.predict_proba
)
displayHTML(exp.as_html())
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.