Giter VIP home page Giter VIP logo

Comments (1)

CloseChoice avatar CloseChoice commented on May 28, 2024

Thanks for the report. Here is a version of your code that is better reproducible:

import shap
import numpy as np

# Plot the SHAP values for the Malignant case
expected_value = -0.43953
shap_values = np.array([ 0.        ,  0.        ,  0.25509583,  0.23371664,  0.        ,
                         0.        ,  0.        ,  0.        ,  0.        ,  0.        ,
                         0.        ,  0.01199562,  0.        , -0.09863244,  0.01999477,
                         0.        ,  0.        ,  0.        ,  0.        ,  0.        ,
                         0.02997689,  0.        ,  0.11880713, -2.51902776,  0.        ,
                         0.        ,  0.        ,  0.        ,  0.        ,  0.        ])

X_test = np.array(
      [1.940e+01, 2.350e+01, 1.291e+02, 1.155e+03, 1.027e-01, 1.558e-01,
       2.049e-01, 8.886e-02, 1.978e-01, 6.000e-02, 5.243e-01, 1.802e+00,
       4.037e+00, 6.041e+01, 1.061e-02, 3.252e-02, 3.915e-02, 1.559e-02,
       2.186e-02, 3.949e-03, 2.165e+01, 3.053e+01, 1.449e+02, 1.417e+03,
       1.463e-01, 2.968e-01, 3.458e-01, 1.564e-01, 2.920e-01, 7.614e-02]
       )
plot = shap.force_plot(expected_value, 
                       shap_values, 
                       X_test, 
                       link="logit",
                       matplotlib=True)

But for me that works on master. Could you please also post the error message?

Edit: this is possibly related to #3448

from shap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.