roc

Fill_between python matplotlib not working as expected (ROC curve)

Fill_between python matplotlib not working as expected (ROC curve) Question: I’m trying to fill in between two curves. It is supposed to be a ROC curve (with lower/upper boundaries) but I’m trying to plot only the lower boundary here for simplicity. import numpy as np from matplotlib import pyplot as plt tpr_mean = np.array([1.00000000e+00, 1.00000000e+00, …

Total answers: 2

ROC_Curve multiclass format is not supported

ROC_Curve multiclass format is not supported Question: I am trying to generate a ROC curve based on predictions from a classifier using the two best performing features in the data set. I am encountering a ValueError: multiclass format is not supported. This the code that the error is coming from, particularly the line 3rd from …

Total answers: 1

sklearn ImportError: cannot import name plot_roc_curve

sklearn ImportError: cannot import name plot_roc_curve Question: I am trying to plot a Receiver Operating Characteristics (ROC) curve with cross validation, following the example provided in sklearn’s documentation. However, the following import gives an ImportError, in both python2 and python3. from sklearn.metrics import plot_roc_curve Error: Traceback (most recent call last): File “<stdin>”, line 1, in …

Total answers: 6

ROC curve for Isolation Forest

ROC curve for Isolation Forest Question: I am trying to plot the ROC curve to evaluate the accuracy of Isolation Forest for a Breast Cancer dataset. I calculated the True Positive rate (TPR) and False Positive Rate (FPR) from the confusion matrix. However, I do not understand how the TPR and FPR are in the …

Total answers: 3

scikit-learn: How do I define the thresholds for the ROC curve?

scikit-learn: How do I define the thresholds for the ROC curve? Question: When plotting the ROC (or deriving the AUC) in scikit-learn, how can one specify arbitrary thresholds for roc_curve, rather than having the function calculate them internally and return them? from sklearn.metrics import roc_curve fpr,tpr,thresholds = roc_curve(y_true,y_pred) A related question was asked at Scikit …

Total answers: 2

ROC for multiclass classification

ROC for multiclass classification Question: I’m doing different text classification experiments. Now I need to calculate the AUC-ROC for each task. For the binary classifications, I already made it work with this code: scaler = StandardScaler(with_mean=False) enc = LabelEncoder() y = enc.fit_transform(labels) feat_sel = SelectKBest(mutual_info_classif, k=200) clf = linear_model.LogisticRegression() pipe = Pipeline([(‘vectorizer’, DictVectorizer()), (‘scaler’, StandardScaler(with_mean=False)), …

Total answers: 4

Simple line plots using seaborn

Simple line plots using seaborn Question: I’m trying to plot a ROC curve using seaborn (python). With matplotlib I simply use the function plot: plt.plot(one_minus_specificity, sensitivity, ‘bs–‘) where one_minus_specificity and sensitivity are two lists of paired values. Is there a simple counterparts of the plot function in seaborn? I had a look at the gallery …

Total answers: 4

Roc curve and cut off point. Python

Roc curve and cut off point. Python Question: I ran a logistic regression model and made predictions of the logit values. I used this to get the points on the ROC curve: from sklearn import metrics fpr, tpr, thresholds = metrics.roc_curve(Y_test,p) I know metrics.roc_auc_score gives the area under the ROC curve. Can anyone tell me …

Total answers: 5

scikit-learn – ROC curve with confidence intervals

scikit-learn – ROC curve with confidence intervals Question: I am able to get a ROC curve using scikit-learn with fpr, tpr, thresholds = metrics.roc_curve(y_true,y_pred, pos_label=1), where y_true is a list of values based on my gold standard (i.e., 0 for negative and 1 for positive cases) and y_pred is a corresponding list of scores (e.g., …

Total answers: 2