-
Notifications
You must be signed in to change notification settings - Fork 114
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
issue with the predict function, classifier problem, categorical dataset #11
Comments
Sorry for the delay in responding. Are you using the If so, can you please share your code? |
I guess I responded to this via email and forgot the thread |
Hi Marco,
I hope you are doing fine. I had replied to you on github, but I did not
receive any response regarding my question. I was hoping if you could help
me with the issue.
Below is the response to the question you had asked me :
I am using the categorical_features parameter with all the features in the
dataset.
The dataset has categorical features only. These features when fed to the
model are discretized by anchor, and this doubles the number of feature
vectors (the original 51 feature vectors are converted into 102 feature
vectors).
[image: screen shot 2018-05-01 at 10 27 38 am]
<https://user-images.githubusercontent.com/34525437/39484664-4b85ccfa-4d2b-11e8-92bd-09fbaf24a22e.png>
clf is a one class SVM model.
exp = explainer.explain_instance(test_data[idx], clf.predict,
threshold=0.95)
The error it throws is :
return classifier_fn(self.encoder.transform(x))
ValueError: cannot use sparse input in 'OneClassSVM' trained on dense data
It would be nice if we could take it from here.
Thank you,
Shaarvani
…On Fri, May 18, 2018 at 7:18 PM, Marco Tulio Correia Ribeiro < ***@***.***> wrote:
I guess I responded to this via email and forgot the thread
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#11 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Ag7Q_ew4eyn8d2xh20hrSqx25CbXgog-ks5tz4DdgaJpZM4TUvd5>
.
|
how about this, try encapsulating the SVM function:
And use this in explain_instance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I found the paper on anchor extremely interesting. The dataset I have only has categorical features with values 0 and 1. I tested it for different models but the code, throws an error in the line, classifier_fn(self.encoder.transform(x)) . As the feature vectors that the dataset has are already discretized, anchor discretizes it further, irrespective of the input throwing an error from the predict function. Could you please help me with the issue. Thanks.
The text was updated successfully, but these errors were encountered: