Support Vector Machines and ROCAUC
See original GitHub issueDescribe the bug ROCAUC fails with support vector machines. This doesn’t happen to me with other algorithms.
To Reproduce
model = SVC()
viz = ROCAUC(model, n_jobs=-1)
viz.fit(X_train, y_train)
viz.score(X_test, y_test)
Dataset I’m using the credit dataset on Yellowbrick
Expected behavior To obtain the ROC plot
/media/Data/Gatech/machine-learning/supervised-learning/helpers.py in plt_roc(model, X_train, y_train, X_test, y_test)
30 viz = ROCAUC(model, n_jobs=-1)
31 viz.fit(X_train, y_train)
---> 32 viz.score(X_test, y_test)
33 return viz
34
~/venvs/global/lib/python3.6/site-packages/yellowbrick/classifier/rocauc.py in score(self, X, y, **kwargs)
176 # Compute ROC curve and ROC area for each class
177 for i, c in enumerate(classes):
--> 178 self.fpr[i], self.tpr[i], _ = roc_curve(y, y_pred[:,i], pos_label=c)
179 self.roc_auc[i] = auc(self.fpr[i], self.tpr[i])
IndexError: too many indices for array
Desktop (please complete the following information):
- OS: Ubuntu 18.04
- Python Version: 3.6.5
- Yellowbrick Version: 0.8
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Plotting ROC & AUC for SVM algorithm
The function roc_curve computes the receiver operating characteristic curve or ROC curve. model = SGDClassifier(loss='hinge',alpha = ...
Read more >How can I plot/determine ROC/AUC for SVM? - ResearchGate
Split your dataset into a training set and a testing set; Train your SVM using the training set only; Evaluate the testing set...
Read more >Classification: ROC Curve and AUC | Machine Learning
An ROC curve (receiver operating characteristic curve) is a graph showing the performance of a classification model at all classification ...
Read more >AUC-ROC Curve in Machine Learning Clearly Explained
We'll cover topics like sensitivity and specificity as well since these are key topics behind the AUC-ROC curve (or ROC AUC curve in...
Read more >Bayes Hyperparameteroptimization for one-class Support ...
Learn more about one-class support vector machine, ... for one-class Support Vector Machines with ROC AUC as Loss possible?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for fixing it and working on such a fantastic library ! Best, Fran
Thanks @TaiChiTiger for your note!