question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Vector Machines and ROCAUC

See original GitHub issue

Describe 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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
FranGoitiacommented, Sep 15, 2018

Thank you for fixing it and working on such a fantastic library ! Best, Fran

0reactions
bbengfortcommented, Jan 15, 2020

Thanks @TaiChiTiger for your note!

Read more comments on GitHub >

github_iconTop 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 Hyperparam​eteroptimi​zation 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found