Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Shap rendering in Azure Data Studio

I'm unable to run shap.initjs() in Azure Data Studio Notebooks. Gave up looking up the issue on Azure community forum or elsewhere.

Visualization omitted, Javascript library not loaded!

shap.initjs()
test_sample = test_x.iloc[:2000,:]
shap_values_sample = explainer.shap_values(test_sample)
shap.force_plot(explainer.expected_value[1], shap_values_sample[1], test_sample, link="logit")
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I got a solution for Databricks. You just need to get the HTML out of force_plot and use displayHTML to see the force_plot. Try this:

force_plot = shap.force_plot(xgb_explainer.expected_value, xgb_shap_values, X_test, matplotlib=False)
shap_html = f"<head>{shap.getjs()}</head><body>{force_plot.html()}</body>"
displayHTML(shap_html)

more info: https://towardsdatascience.com/tutorial-on-displaying-shap-force-plots-in-python-html-4883aeb0ee7c

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!