Skip to content

Commit 78bfac2

Browse files
DeprecationWarning: scipy.interp is deprecated and will be removed in SciPy 2.0.0, use numpy.interp instead scikit-learn/scikit-learn#21911
1 parent 558f4c6 commit 78bfac2

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

scikitplot/metrics.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
from sklearn.calibration import calibration_curve
2525
from sklearn.utils import deprecated
2626

27-
from scipy import interp
28-
2927
from scikitplot.helpers import binary_ks_curve, validate_labels
3028
from scikitplot.helpers import cumulative_gain_curve
3129

@@ -281,7 +279,7 @@ def plot_roc_curve(y_true, y_probas, title='ROC Curves',
281279
# Then interpolate all ROC curves at this points
282280
mean_tpr = np.zeros_like(all_fpr)
283281
for i in range(len(classes)):
284-
mean_tpr += interp(all_fpr, fpr[i], tpr[i])
282+
mean_tpr += np.interp(all_fpr, fpr[i], tpr[i])
285283

286284
# Finally average it and compute AUC
287285
mean_tpr /= len(classes)
@@ -440,7 +438,7 @@ def plot_roc(y_true, y_probas, title='ROC Curves',
440438
# Then interpolate all ROC curves at this points
441439
mean_tpr = np.zeros_like(all_fpr)
442440
for i in range(len(classes)):
443-
mean_tpr += interp(all_fpr, fpr_dict[i], tpr_dict[i])
441+
mean_tpr += np.interp(all_fpr, fpr_dict[i], tpr_dict[i])
444442

445443
# Finally average it and compute AUC
446444
mean_tpr /= len(classes)

scikitplot/plotters.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
from sklearn.metrics import silhouette_samples
2626
from sklearn.utils import deprecated
2727

28-
from scipy import interp
29-
3028
from scikitplot.helpers import binary_ks_curve, validate_labels
3129

3230

@@ -282,7 +280,7 @@ def plot_roc_curve(y_true, y_probas, title='ROC Curves',
282280
# Then interpolate all ROC curves at this points
283281
mean_tpr = np.zeros_like(all_fpr)
284282
for i in range(len(classes)):
285-
mean_tpr += interp(all_fpr, fpr[i], tpr[i])
283+
mean_tpr += np.interp(all_fpr, fpr[i], tpr[i])
286284

287285
# Finally average it and compute AUC
288286
mean_tpr /= len(classes)

0 commit comments

Comments
 (0)