Skip to content

Commit 30780db

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 4493f86c463689e4fed76240bfac98f9252d1bbd
1 parent 8159dfe commit 30780db

File tree

1,563 files changed

+6314
-6138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,563 files changed

+6314
-6138
lines changed

dev/_downloads/010337852815f8103ac6cca38a812b3c/plot_roc_crossval.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@
8989
X[test],
9090
y[test],
9191
name=f"ROC fold {fold}",
92-
alpha=0.3,
93-
lw=1,
92+
curve_kwargs=dict(alpha=0.3, lw=1),
9493
ax=ax,
9594
plot_chance_level=(fold == n_splits - 1),
9695
)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/055e8313e28f2f3b5fd508054dfe5fe0/plot_roc_crossval.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"outputs": [],
7171
"source": [
72-
"import matplotlib.pyplot as plt\n\nfrom sklearn import svm\nfrom sklearn.metrics import RocCurveDisplay, auc\nfrom sklearn.model_selection import StratifiedKFold\n\nn_splits = 6\ncv = StratifiedKFold(n_splits=n_splits)\nclassifier = svm.SVC(kernel=\"linear\", probability=True, random_state=random_state)\n\ntprs = []\naucs = []\nmean_fpr = np.linspace(0, 1, 100)\n\nfig, ax = plt.subplots(figsize=(6, 6))\nfor fold, (train, test) in enumerate(cv.split(X, y)):\n classifier.fit(X[train], y[train])\n viz = RocCurveDisplay.from_estimator(\n classifier,\n X[test],\n y[test],\n name=f\"ROC fold {fold}\",\n alpha=0.3,\n lw=1,\n ax=ax,\n plot_chance_level=(fold == n_splits - 1),\n )\n interp_tpr = np.interp(mean_fpr, viz.fpr, viz.tpr)\n interp_tpr[0] = 0.0\n tprs.append(interp_tpr)\n aucs.append(viz.roc_auc)\n\nmean_tpr = np.mean(tprs, axis=0)\nmean_tpr[-1] = 1.0\nmean_auc = auc(mean_fpr, mean_tpr)\nstd_auc = np.std(aucs)\nax.plot(\n mean_fpr,\n mean_tpr,\n color=\"b\",\n label=r\"Mean ROC (AUC = %0.2f $\\pm$ %0.2f)\" % (mean_auc, std_auc),\n lw=2,\n alpha=0.8,\n)\n\nstd_tpr = np.std(tprs, axis=0)\ntprs_upper = np.minimum(mean_tpr + std_tpr, 1)\ntprs_lower = np.maximum(mean_tpr - std_tpr, 0)\nax.fill_between(\n mean_fpr,\n tprs_lower,\n tprs_upper,\n color=\"grey\",\n alpha=0.2,\n label=r\"$\\pm$ 1 std. dev.\",\n)\n\nax.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=f\"Mean ROC curve with variability\\n(Positive label '{target_names[1]}')\",\n)\nax.legend(loc=\"lower right\")\nplt.show()"
72+
"import matplotlib.pyplot as plt\n\nfrom sklearn import svm\nfrom sklearn.metrics import RocCurveDisplay, auc\nfrom sklearn.model_selection import StratifiedKFold\n\nn_splits = 6\ncv = StratifiedKFold(n_splits=n_splits)\nclassifier = svm.SVC(kernel=\"linear\", probability=True, random_state=random_state)\n\ntprs = []\naucs = []\nmean_fpr = np.linspace(0, 1, 100)\n\nfig, ax = plt.subplots(figsize=(6, 6))\nfor fold, (train, test) in enumerate(cv.split(X, y)):\n classifier.fit(X[train], y[train])\n viz = RocCurveDisplay.from_estimator(\n classifier,\n X[test],\n y[test],\n name=f\"ROC fold {fold}\",\n curve_kwargs=dict(alpha=0.3, lw=1),\n ax=ax,\n plot_chance_level=(fold == n_splits - 1),\n )\n interp_tpr = np.interp(mean_fpr, viz.fpr, viz.tpr)\n interp_tpr[0] = 0.0\n tprs.append(interp_tpr)\n aucs.append(viz.roc_auc)\n\nmean_tpr = np.mean(tprs, axis=0)\nmean_tpr[-1] = 1.0\nmean_auc = auc(mean_fpr, mean_tpr)\nstd_auc = np.std(aucs)\nax.plot(\n mean_fpr,\n mean_tpr,\n color=\"b\",\n label=r\"Mean ROC (AUC = %0.2f $\\pm$ %0.2f)\" % (mean_auc, std_auc),\n lw=2,\n alpha=0.8,\n)\n\nstd_tpr = np.std(tprs, axis=0)\ntprs_upper = np.minimum(mean_tpr + std_tpr, 1)\ntprs_lower = np.maximum(mean_tpr - std_tpr, 0)\nax.fill_between(\n mean_fpr,\n tprs_lower,\n tprs_upper,\n color=\"grey\",\n alpha=0.2,\n label=r\"$\\pm$ 1 std. dev.\",\n)\n\nax.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=f\"Mean ROC curve with variability\\n(Positive label '{target_names[1]}')\",\n)\nax.legend(loc=\"lower right\")\nplt.show()"
7373
]
7474
}
7575
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/10bb40e21b74618cdeed618ff1eae595/plot_det.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"outputs": [],
7171
"source": [
72-
"import matplotlib.pyplot as plt\n\nfrom sklearn.dummy import DummyClassifier\nfrom sklearn.metrics import DetCurveDisplay, RocCurveDisplay\n\nfig, [ax_roc, ax_det] = plt.subplots(1, 2, figsize=(11, 5))\n\nax_roc.set_title(\"Receiver Operating Characteristic (ROC) curves\")\nax_det.set_title(\"Detection Error Tradeoff (DET) curves\")\n\nax_roc.grid(linestyle=\"--\")\nax_det.grid(linestyle=\"--\")\n\nfor name, clf in classifiers.items():\n (color, linestyle) = (\n (\"black\", \"--\") if name == \"Non-informative baseline\" else (None, None)\n )\n clf.fit(X_train, y_train)\n RocCurveDisplay.from_estimator(\n clf, X_test, y_test, ax=ax_roc, name=name, color=color, linestyle=linestyle\n )\n DetCurveDisplay.from_estimator(\n clf, X_test, y_test, ax=ax_det, name=name, color=color, linestyle=linestyle\n )\n\nplt.legend()\nplt.show()"
72+
"import matplotlib.pyplot as plt\n\nfrom sklearn.dummy import DummyClassifier\nfrom sklearn.metrics import DetCurveDisplay, RocCurveDisplay\n\nfig, [ax_roc, ax_det] = plt.subplots(1, 2, figsize=(11, 5))\n\nax_roc.set_title(\"Receiver Operating Characteristic (ROC) curves\")\nax_det.set_title(\"Detection Error Tradeoff (DET) curves\")\n\nax_roc.grid(linestyle=\"--\")\nax_det.grid(linestyle=\"--\")\n\nfor name, clf in classifiers.items():\n (color, linestyle) = (\n (\"black\", \"--\") if name == \"Non-informative baseline\" else (None, None)\n )\n clf.fit(X_train, y_train)\n RocCurveDisplay.from_estimator(\n clf,\n X_test,\n y_test,\n ax=ax_roc,\n name=name,\n curve_kwargs=dict(color=color, linestyle=linestyle),\n )\n DetCurveDisplay.from_estimator(\n clf, X_test, y_test, ax=ax_det, name=name, color=color, linestyle=linestyle\n )\n\nplt.legend()\nplt.show()"
7373
]
7474
},
7575
{
Binary file not shown.

dev/_downloads/133f2198d3ab792c75b39a63b0a99872/plot_cost_sensitive_learning.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
},
250250
"outputs": [],
251251
"source": [
252-
"def plot_roc_pr_curves(vanilla_model, tuned_model, *, title):\n fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(21, 6))\n\n linestyles = (\"dashed\", \"dotted\")\n markerstyles = (\"o\", \">\")\n colors = (\"tab:blue\", \"tab:orange\")\n names = (\"Vanilla GBDT\", \"Tuned GBDT\")\n for idx, (est, linestyle, marker, color, name) in enumerate(\n zip((vanilla_model, tuned_model), linestyles, markerstyles, colors, names)\n ):\n decision_threshold = getattr(est, \"best_threshold_\", 0.5)\n PrecisionRecallDisplay.from_estimator(\n est,\n X_test,\n y_test,\n pos_label=pos_label,\n linestyle=linestyle,\n color=color,\n ax=axs[0],\n name=name,\n )\n axs[0].plot(\n scoring[\"recall\"](est, X_test, y_test),\n scoring[\"precision\"](est, X_test, y_test),\n marker,\n markersize=10,\n color=color,\n label=f\"Cut-off point at probability of {decision_threshold:.2f}\",\n )\n RocCurveDisplay.from_estimator(\n est,\n X_test,\n y_test,\n pos_label=pos_label,\n linestyle=linestyle,\n color=color,\n ax=axs[1],\n name=name,\n plot_chance_level=idx == 1,\n )\n axs[1].plot(\n scoring[\"fpr\"](est, X_test, y_test),\n scoring[\"tpr\"](est, X_test, y_test),\n marker,\n markersize=10,\n color=color,\n label=f\"Cut-off point at probability of {decision_threshold:.2f}\",\n )\n\n axs[0].set_title(\"Precision-Recall curve\")\n axs[0].legend()\n axs[1].set_title(\"ROC curve\")\n axs[1].legend()\n\n axs[2].plot(\n tuned_model.cv_results_[\"thresholds\"],\n tuned_model.cv_results_[\"scores\"],\n color=\"tab:orange\",\n )\n axs[2].plot(\n tuned_model.best_threshold_,\n tuned_model.best_score_,\n \"o\",\n markersize=10,\n color=\"tab:orange\",\n label=\"Optimal cut-off point for the business metric\",\n )\n axs[2].legend()\n axs[2].set_xlabel(\"Decision threshold (probability)\")\n axs[2].set_ylabel(\"Objective score (using cost-matrix)\")\n axs[2].set_title(\"Objective score as a function of the decision threshold\")\n fig.suptitle(title)"
252+
"def plot_roc_pr_curves(vanilla_model, tuned_model, *, title):\n fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(21, 6))\n\n linestyles = (\"dashed\", \"dotted\")\n markerstyles = (\"o\", \">\")\n colors = (\"tab:blue\", \"tab:orange\")\n names = (\"Vanilla GBDT\", \"Tuned GBDT\")\n for idx, (est, linestyle, marker, color, name) in enumerate(\n zip((vanilla_model, tuned_model), linestyles, markerstyles, colors, names)\n ):\n decision_threshold = getattr(est, \"best_threshold_\", 0.5)\n PrecisionRecallDisplay.from_estimator(\n est,\n X_test,\n y_test,\n pos_label=pos_label,\n linestyle=linestyle,\n color=color,\n ax=axs[0],\n name=name,\n )\n axs[0].plot(\n scoring[\"recall\"](est, X_test, y_test),\n scoring[\"precision\"](est, X_test, y_test),\n marker,\n markersize=10,\n color=color,\n label=f\"Cut-off point at probability of {decision_threshold:.2f}\",\n )\n RocCurveDisplay.from_estimator(\n est,\n X_test,\n y_test,\n pos_label=pos_label,\n curve_kwargs=dict(linestyle=linestyle, color=color),\n ax=axs[1],\n name=name,\n plot_chance_level=idx == 1,\n )\n axs[1].plot(\n scoring[\"fpr\"](est, X_test, y_test),\n scoring[\"tpr\"](est, X_test, y_test),\n marker,\n markersize=10,\n color=color,\n label=f\"Cut-off point at probability of {decision_threshold:.2f}\",\n )\n\n axs[0].set_title(\"Precision-Recall curve\")\n axs[0].legend()\n axs[1].set_title(\"ROC curve\")\n axs[1].legend()\n\n axs[2].plot(\n tuned_model.cv_results_[\"thresholds\"],\n tuned_model.cv_results_[\"scores\"],\n color=\"tab:orange\",\n )\n axs[2].plot(\n tuned_model.best_threshold_,\n tuned_model.best_score_,\n \"o\",\n markersize=10,\n color=\"tab:orange\",\n label=\"Optimal cut-off point for the business metric\",\n )\n axs[2].legend()\n axs[2].set_xlabel(\"Decision threshold (probability)\")\n axs[2].set_ylabel(\"Objective score (using cost-matrix)\")\n axs[2].set_title(\"Objective score as a function of the decision threshold\")\n fig.suptitle(title)"
253253
]
254254
},
255255
{
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/3577ee5e1121d4b5da38feb779aa44bb/plot_roc_curve_visualization_api.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"outputs": [],
7171
"source": [
72-
"rfc = RandomForestClassifier(n_estimators=10, random_state=42)\nrfc.fit(X_train, y_train)\nax = plt.gca()\nrfc_disp = RocCurveDisplay.from_estimator(rfc, X_test, y_test, ax=ax, alpha=0.8)\nsvc_disp.plot(ax=ax, alpha=0.8)\nplt.show()"
72+
"rfc = RandomForestClassifier(n_estimators=10, random_state=42)\nrfc.fit(X_train, y_train)\nax = plt.gca()\nrfc_disp = RocCurveDisplay.from_estimator(\n rfc, X_test, y_test, ax=ax, curve_kwargs=dict(alpha=0.8)\n)\nsvc_disp.plot(ax=ax, curve_kwargs=dict(alpha=0.8))\nplt.show()"
7373
]
7474
}
7575
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/40f4aad91af595a370d7582e3a23bed7/plot_roc.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
},
117117
"outputs": [],
118118
"source": [
119-
"import matplotlib.pyplot as plt\n\nfrom sklearn.metrics import RocCurveDisplay\n\ndisplay = RocCurveDisplay.from_predictions(\n y_onehot_test[:, class_id],\n y_score[:, class_id],\n name=f\"{class_of_interest} vs the rest\",\n color=\"darkorange\",\n plot_chance_level=True,\n despine=True,\n)\n_ = display.ax_.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=\"One-vs-Rest ROC curves:\\nVirginica vs (Setosa & Versicolor)\",\n)"
119+
"import matplotlib.pyplot as plt\n\nfrom sklearn.metrics import RocCurveDisplay\n\ndisplay = RocCurveDisplay.from_predictions(\n y_onehot_test[:, class_id],\n y_score[:, class_id],\n name=f\"{class_of_interest} vs the rest\",\n curve_kwargs=dict(color=\"darkorange\"),\n plot_chance_level=True,\n despine=True,\n)\n_ = display.ax_.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=\"One-vs-Rest ROC curves:\\nVirginica vs (Setosa & Versicolor)\",\n)"
120120
]
121121
},
122122
{
@@ -152,7 +152,7 @@
152152
},
153153
"outputs": [],
154154
"source": [
155-
"display = RocCurveDisplay.from_predictions(\n y_onehot_test.ravel(),\n y_score.ravel(),\n name=\"micro-average OvR\",\n color=\"darkorange\",\n plot_chance_level=True,\n despine=True,\n)\n_ = display.ax_.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=\"Micro-averaged One-vs-Rest\\nReceiver Operating Characteristic\",\n)"
155+
"display = RocCurveDisplay.from_predictions(\n y_onehot_test.ravel(),\n y_score.ravel(),\n name=\"micro-average OvR\",\n curve_kwargs=dict(color=\"darkorange\"),\n plot_chance_level=True,\n despine=True,\n)\n_ = display.ax_.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=\"Micro-averaged One-vs-Rest\\nReceiver Operating Characteristic\",\n)"
156156
]
157157
},
158158
{
@@ -242,7 +242,7 @@
242242
},
243243
"outputs": [],
244244
"source": [
245-
"from itertools import cycle\n\nfig, ax = plt.subplots(figsize=(6, 6))\n\nplt.plot(\n fpr[\"micro\"],\n tpr[\"micro\"],\n label=f\"micro-average ROC curve (AUC = {roc_auc['micro']:.2f})\",\n color=\"deeppink\",\n linestyle=\":\",\n linewidth=4,\n)\n\nplt.plot(\n fpr[\"macro\"],\n tpr[\"macro\"],\n label=f\"macro-average ROC curve (AUC = {roc_auc['macro']:.2f})\",\n color=\"navy\",\n linestyle=\":\",\n linewidth=4,\n)\n\ncolors = cycle([\"aqua\", \"darkorange\", \"cornflowerblue\"])\nfor class_id, color in zip(range(n_classes), colors):\n RocCurveDisplay.from_predictions(\n y_onehot_test[:, class_id],\n y_score[:, class_id],\n name=f\"ROC curve for {target_names[class_id]}\",\n color=color,\n ax=ax,\n plot_chance_level=(class_id == 2),\n despine=True,\n )\n\n_ = ax.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=\"Extension of Receiver Operating Characteristic\\nto One-vs-Rest multiclass\",\n)"
245+
"from itertools import cycle\n\nfig, ax = plt.subplots(figsize=(6, 6))\n\nplt.plot(\n fpr[\"micro\"],\n tpr[\"micro\"],\n label=f\"micro-average ROC curve (AUC = {roc_auc['micro']:.2f})\",\n color=\"deeppink\",\n linestyle=\":\",\n linewidth=4,\n)\n\nplt.plot(\n fpr[\"macro\"],\n tpr[\"macro\"],\n label=f\"macro-average ROC curve (AUC = {roc_auc['macro']:.2f})\",\n color=\"navy\",\n linestyle=\":\",\n linewidth=4,\n)\n\ncolors = cycle([\"aqua\", \"darkorange\", \"cornflowerblue\"])\nfor class_id, color in zip(range(n_classes), colors):\n RocCurveDisplay.from_predictions(\n y_onehot_test[:, class_id],\n y_score[:, class_id],\n name=f\"ROC curve for {target_names[class_id]}\",\n curve_kwargs=dict(color=color),\n ax=ax,\n plot_chance_level=(class_id == 2),\n despine=True,\n )\n\n_ = ax.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=\"Extension of Receiver Operating Characteristic\\nto One-vs-Rest multiclass\",\n)"
246246
]
247247
},
248248
{
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/67703ae8c65716668dd87c31a24a069b/plot_det.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@
103103
)
104104
clf.fit(X_train, y_train)
105105
RocCurveDisplay.from_estimator(
106-
clf, X_test, y_test, ax=ax_roc, name=name, color=color, linestyle=linestyle
106+
clf,
107+
X_test,
108+
y_test,
109+
ax=ax_roc,
110+
name=name,
111+
curve_kwargs=dict(color=color, linestyle=linestyle),
107112
)
108113
DetCurveDisplay.from_estimator(
109114
clf, X_test, y_test, ax=ax_det, name=name, color=color, linestyle=linestyle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/80fef09514fd851560e999a5b7daa303/plot_roc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
y_onehot_test[:, class_id],
130130
y_score[:, class_id],
131131
name=f"{class_of_interest} vs the rest",
132-
color="darkorange",
132+
curve_kwargs=dict(color="darkorange"),
133133
plot_chance_level=True,
134134
despine=True,
135135
)
@@ -165,7 +165,7 @@
165165
y_onehot_test.ravel(),
166166
y_score.ravel(),
167167
name="micro-average OvR",
168-
color="darkorange",
168+
curve_kwargs=dict(color="darkorange"),
169169
plot_chance_level=True,
170170
despine=True,
171171
)
@@ -290,7 +290,7 @@
290290
y_onehot_test[:, class_id],
291291
y_score[:, class_id],
292292
name=f"ROC curve for {target_names[class_id]}",
293-
color=color,
293+
curve_kwargs=dict(color=color),
294294
ax=ax,
295295
plot_chance_level=(class_id == 2),
296296
despine=True,
Binary file not shown.
Binary file not shown.

dev/_downloads/837ade0d39a9ca8d8a3cc25eb9433a58/plot_roc_curve_visualization_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
rfc = RandomForestClassifier(n_estimators=10, random_state=42)
5555
rfc.fit(X_train, y_train)
5656
ax = plt.gca()
57-
rfc_disp = RocCurveDisplay.from_estimator(rfc, X_test, y_test, ax=ax, alpha=0.8)
58-
svc_disp.plot(ax=ax, alpha=0.8)
57+
rfc_disp = RocCurveDisplay.from_estimator(
58+
rfc, X_test, y_test, ax=ax, curve_kwargs=dict(alpha=0.8)
59+
)
60+
svc_disp.plot(ax=ax, curve_kwargs=dict(alpha=0.8))
5961
plt.show()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/9ca7cbe47e4cace7242fe4c5c43dfa52/plot_cost_sensitive_learning.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ def plot_roc_pr_curves(vanilla_model, tuned_model, *, title):
321321
X_test,
322322
y_test,
323323
pos_label=pos_label,
324-
linestyle=linestyle,
325-
color=color,
324+
curve_kwargs=dict(linestyle=linestyle, color=color),
326325
ax=axs[1],
327326
name=name,
328327
plot_chance_level=idx == 1,
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/b7e32fe54d613dce0d3c376377af061d/plot_outlier_detection_bench.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ def fit_predict(estimator, X):
355355
ax=ax,
356356
plot_chance_level=(model_idx == len(n_neighbors_list) - 1),
357357
chance_level_kw={"linestyle": (0, (1, 10))},
358-
linestyle=linestyle,
359-
linewidth=2,
358+
curve_kwargs=dict(linestyle=linestyle, linewidth=2),
360359
)
361360
_ = ax.set_title("RobustScaler with varying n_neighbors\non forestcover dataset")
362361

@@ -395,8 +394,7 @@ def fit_predict(estimator, X):
395394
ax=ax,
396395
plot_chance_level=(model_idx == len(preprocessor_list) - 1),
397396
chance_level_kw={"linestyle": (0, (1, 10))},
398-
linestyle=linestyle,
399-
linewidth=2,
397+
curve_kwargs=dict(linestyle=linestyle, linewidth=2),
400398
)
401399
_ = ax.set_title("Fixed n_neighbors with varying preprocessing\non forestcover dataset")
402400

@@ -447,8 +445,7 @@ def fit_predict(estimator, X):
447445
ax=ax,
448446
plot_chance_level=(model_idx == len(preprocessor_list) - 1),
449447
chance_level_kw={"linestyle": (0, (1, 10))},
450-
linestyle=linestyle,
451-
linewidth=2,
448+
curve_kwargs=dict(linestyle=linestyle, linewidth=2),
452449
)
453450
ax.set_title(
454451
"Fixed n_neighbors with varying preprocessing\non cardiotocography dataset"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)