Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use ShapModelInterpreter for SVC (multi-class)? #270

Open
jeong2624 opened this issue Sep 19, 2024 · 0 comments
Open

How to use ShapModelInterpreter for SVC (multi-class)? #270

jeong2624 opened this issue Sep 19, 2024 · 0 comments

Comments

@jeong2624
Copy link

jeong2624 commented Sep 19, 2024

I ran the function ShapModelInterpreter(X, y), but the error occurs.
AttributeError: 'SVC' object has no attribute 'classes_'

How can I obtain a SHAP feature importance plot for a multi-class SVC model?

If you read this message, please resolve the issue as quickly as possible.

Environment (please complete the following information):

probatus version : 3.1.0
python version : 3.9.0
OS: macOS

To Reproduce

Put your code here

from probatus.interpret import ShapModelInterpreter
model = SVC(random_state = 42, probability = True, kernel = "linear")
shap_interpreter = ShapModelInterpreter(model)
feature_importance = shap_interpreter.fit_compute(X_train, X_test, y_train, y_test)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant