Skip to content

Commit 860856c

Browse files
committed
Pushing the docs to dev/ for branch: main, commit ff78e258ccf11068e2b3a433c51517ae56234f88
1 parent fb156cd commit 860856c

File tree

1,573 files changed

+6138
-6150
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,573 files changed

+6138
-6150
lines changed
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/1bba2567637a1618250bc13e249eb0d7/plot_partial_dependence_visualization_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
See also :ref:`sphx_glr_auto_examples_miscellaneous_plot_roc_curve_visualization_api.py`
1313
14-
""" # noqa: E501
14+
"""
1515

1616
# Authors: The scikit-learn developers
1717
# SPDX-License-Identifier: BSD-3-Clause
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/2b2bebba7f9fb4d03b9c12d63c8b44ad/plot_topics_extraction_with_nmf_lda.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def plot_top_words(model, feature_names, n_top_words, title):
5050

5151
ax = axes[topic_idx]
5252
ax.barh(top_features, weights, height=0.7)
53-
ax.set_title(f"Topic {topic_idx +1}", fontdict={"fontsize": 30})
53+
ax.set_title(f"Topic {topic_idx + 1}", fontdict={"fontsize": 30})
5454
ax.tick_params(axis="both", which="major", labelsize=20)
5555
for i in "top right left".split():
5656
ax.spines[i].set_visible(False)
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/40f4aad91af595a370d7582e3a23bed7/plot_roc.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
},
135135
"outputs": [],
136136
"source": [
137-
"print(f\"y_score:\\n{y_score[0:2,:]}\")\nprint()\nprint(f\"y_score.ravel():\\n{y_score[0:2,:].ravel()}\")"
137+
"print(f\"y_score:\\n{y_score[0:2, :]}\")\nprint()\nprint(f\"y_score.ravel():\\n{y_score[0:2, :].ravel()}\")"
138138
]
139139
},
140140
{
@@ -271,7 +271,7 @@
271271
},
272272
"outputs": [],
273273
"source": [
274-
"pair_scores = []\nmean_tpr = dict()\n\nfor ix, (label_a, label_b) in enumerate(pair_list):\n a_mask = y_test == label_a\n b_mask = y_test == label_b\n ab_mask = np.logical_or(a_mask, b_mask)\n\n a_true = a_mask[ab_mask]\n b_true = b_mask[ab_mask]\n\n idx_a = np.flatnonzero(label_binarizer.classes_ == label_a)[0]\n idx_b = np.flatnonzero(label_binarizer.classes_ == label_b)[0]\n\n fpr_a, tpr_a, _ = roc_curve(a_true, y_score[ab_mask, idx_a])\n fpr_b, tpr_b, _ = roc_curve(b_true, y_score[ab_mask, idx_b])\n\n mean_tpr[ix] = np.zeros_like(fpr_grid)\n mean_tpr[ix] += np.interp(fpr_grid, fpr_a, tpr_a)\n mean_tpr[ix] += np.interp(fpr_grid, fpr_b, tpr_b)\n mean_tpr[ix] /= 2\n mean_score = auc(fpr_grid, mean_tpr[ix])\n pair_scores.append(mean_score)\n\n fig, ax = plt.subplots(figsize=(6, 6))\n plt.plot(\n fpr_grid,\n mean_tpr[ix],\n label=f\"Mean {label_a} vs {label_b} (AUC = {mean_score :.2f})\",\n linestyle=\":\",\n linewidth=4,\n )\n RocCurveDisplay.from_predictions(\n a_true,\n y_score[ab_mask, idx_a],\n ax=ax,\n name=f\"{label_a} as positive class\",\n )\n RocCurveDisplay.from_predictions(\n b_true,\n y_score[ab_mask, idx_b],\n ax=ax,\n name=f\"{label_b} as positive class\",\n plot_chance_level=True,\n despine=True,\n )\n ax.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=f\"{target_names[idx_a]} vs {label_b} ROC curves\",\n )\n\nprint(f\"Macro-averaged One-vs-One ROC AUC score:\\n{np.average(pair_scores):.2f}\")"
274+
"pair_scores = []\nmean_tpr = dict()\n\nfor ix, (label_a, label_b) in enumerate(pair_list):\n a_mask = y_test == label_a\n b_mask = y_test == label_b\n ab_mask = np.logical_or(a_mask, b_mask)\n\n a_true = a_mask[ab_mask]\n b_true = b_mask[ab_mask]\n\n idx_a = np.flatnonzero(label_binarizer.classes_ == label_a)[0]\n idx_b = np.flatnonzero(label_binarizer.classes_ == label_b)[0]\n\n fpr_a, tpr_a, _ = roc_curve(a_true, y_score[ab_mask, idx_a])\n fpr_b, tpr_b, _ = roc_curve(b_true, y_score[ab_mask, idx_b])\n\n mean_tpr[ix] = np.zeros_like(fpr_grid)\n mean_tpr[ix] += np.interp(fpr_grid, fpr_a, tpr_a)\n mean_tpr[ix] += np.interp(fpr_grid, fpr_b, tpr_b)\n mean_tpr[ix] /= 2\n mean_score = auc(fpr_grid, mean_tpr[ix])\n pair_scores.append(mean_score)\n\n fig, ax = plt.subplots(figsize=(6, 6))\n plt.plot(\n fpr_grid,\n mean_tpr[ix],\n label=f\"Mean {label_a} vs {label_b} (AUC = {mean_score:.2f})\",\n linestyle=\":\",\n linewidth=4,\n )\n RocCurveDisplay.from_predictions(\n a_true,\n y_score[ab_mask, idx_a],\n ax=ax,\n name=f\"{label_a} as positive class\",\n )\n RocCurveDisplay.from_predictions(\n b_true,\n y_score[ab_mask, idx_b],\n ax=ax,\n name=f\"{label_b} as positive class\",\n plot_chance_level=True,\n despine=True,\n )\n ax.set(\n xlabel=\"False Positive Rate\",\n ylabel=\"True Positive Rate\",\n title=f\"{target_names[idx_a]} vs {label_b} ROC curves\",\n )\n\nprint(f\"Macro-averaged One-vs-One ROC AUC score:\\n{np.average(pair_scores):.2f}\")"
275275
]
276276
},
277277
{
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/4fe7ce5d502ee21f3c344f775829354a/plot_bias_variance.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ def generate(n_samples, noise, n_repeat=1):
177177

178178
plt.subplot(2, n_estimators, n_estimators + n + 1)
179179
plt.plot(X_test, y_error, "r", label="$error(x)$")
180-
plt.plot(X_test, y_bias, "b", label="$bias^2(x)$"),
181-
plt.plot(X_test, y_var, "g", label="$variance(x)$"),
180+
plt.plot(X_test, y_bias, "b", label="$bias^2(x)$")
181+
plt.plot(X_test, y_var, "g", label="$variance(x)$")
182182
plt.plot(X_test, y_noise, "c", label="$noise(x)$")
183183

184184
plt.xlim([-5, 5])
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/53e76f761ef04e8d06fa5757554513b0/plot_select_from_model_diabetes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# were already standardized.
4141
# For a more complete example on the interpretations of the coefficients of
4242
# linear models, you may refer to
43-
# :ref:`sphx_glr_auto_examples_inspection_plot_linear_model_coefficient_interpretation.py`. # noqa: E501
43+
# :ref:`sphx_glr_auto_examples_inspection_plot_linear_model_coefficient_interpretation.py`.
4444
import matplotlib.pyplot as plt
4545
import numpy as np
4646

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/604c0a9de0e1b80dae9e6754fdb27014/plot_manifold_sphere.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"# Authors: The scikit-learn developers\n# SPDX-License-Identifier: BSD-3-Clause\n\nfrom time import time\n\nimport matplotlib.pyplot as plt\n\n# Unused but required import for doing 3d projections with matplotlib < 3.2\nimport mpl_toolkits.mplot3d # noqa: F401\nimport numpy as np\nfrom matplotlib.ticker import NullFormatter\n\nfrom sklearn import manifold\nfrom sklearn.utils import check_random_state\n\n# Variables for manifold learning.\nn_neighbors = 10\nn_samples = 1000\n\n# Create our sphere.\nrandom_state = check_random_state(0)\np = random_state.rand(n_samples) * (2 * np.pi - 0.55)\nt = random_state.rand(n_samples) * np.pi\n\n# Sever the poles from the sphere.\nindices = (t < (np.pi - (np.pi / 8))) & (t > ((np.pi / 8)))\ncolors = p[indices]\nx, y, z = (\n np.sin(t[indices]) * np.cos(p[indices]),\n np.sin(t[indices]) * np.sin(p[indices]),\n np.cos(t[indices]),\n)\n\n# Plot our dataset.\nfig = plt.figure(figsize=(15, 8))\nplt.suptitle(\n \"Manifold Learning with %i points, %i neighbors\" % (1000, n_neighbors), fontsize=14\n)\n\nax = fig.add_subplot(251, projection=\"3d\")\nax.scatter(x, y, z, c=p[indices], cmap=plt.cm.rainbow)\nax.view_init(40, -10)\n\nsphere_data = np.array([x, y, z]).T\n\n# Perform Locally Linear Embedding Manifold learning\nmethods = [\"standard\", \"ltsa\", \"hessian\", \"modified\"]\nlabels = [\"LLE\", \"LTSA\", \"Hessian LLE\", \"Modified LLE\"]\n\nfor i, method in enumerate(methods):\n t0 = time()\n trans_data = (\n manifold.LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=method, random_state=42\n )\n .fit_transform(sphere_data)\n .T\n )\n t1 = time()\n print(\"%s: %.2g sec\" % (methods[i], t1 - t0))\n\n ax = fig.add_subplot(252 + i)\n plt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\n plt.title(\"%s (%.2g sec)\" % (labels[i], t1 - t0))\n ax.xaxis.set_major_formatter(NullFormatter())\n ax.yaxis.set_major_formatter(NullFormatter())\n plt.axis(\"tight\")\n\n# Perform Isomap Manifold learning.\nt0 = time()\ntrans_data = (\n manifold.Isomap(n_neighbors=n_neighbors, n_components=2)\n .fit_transform(sphere_data)\n .T\n)\nt1 = time()\nprint(\"%s: %.2g sec\" % (\"ISO\", t1 - t0))\n\nax = fig.add_subplot(257)\nplt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\nplt.title(\"%s (%.2g sec)\" % (\"Isomap\", t1 - t0))\nax.xaxis.set_major_formatter(NullFormatter())\nax.yaxis.set_major_formatter(NullFormatter())\nplt.axis(\"tight\")\n\n# Perform Multi-dimensional scaling.\nt0 = time()\nmds = manifold.MDS(2, max_iter=100, n_init=1, random_state=42)\ntrans_data = mds.fit_transform(sphere_data).T\nt1 = time()\nprint(\"MDS: %.2g sec\" % (t1 - t0))\n\nax = fig.add_subplot(258)\nplt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\nplt.title(\"MDS (%.2g sec)\" % (t1 - t0))\nax.xaxis.set_major_formatter(NullFormatter())\nax.yaxis.set_major_formatter(NullFormatter())\nplt.axis(\"tight\")\n\n# Perform Spectral Embedding.\nt0 = time()\nse = manifold.SpectralEmbedding(\n n_components=2, n_neighbors=n_neighbors, random_state=42\n)\ntrans_data = se.fit_transform(sphere_data).T\nt1 = time()\nprint(\"Spectral Embedding: %.2g sec\" % (t1 - t0))\n\nax = fig.add_subplot(259)\nplt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\nplt.title(\"Spectral Embedding (%.2g sec)\" % (t1 - t0))\nax.xaxis.set_major_formatter(NullFormatter())\nax.yaxis.set_major_formatter(NullFormatter())\nplt.axis(\"tight\")\n\n# Perform t-distributed stochastic neighbor embedding.\nt0 = time()\ntsne = manifold.TSNE(n_components=2, random_state=0)\ntrans_data = tsne.fit_transform(sphere_data).T\nt1 = time()\nprint(\"t-SNE: %.2g sec\" % (t1 - t0))\n\nax = fig.add_subplot(2, 5, 10)\nplt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\nplt.title(\"t-SNE (%.2g sec)\" % (t1 - t0))\nax.xaxis.set_major_formatter(NullFormatter())\nax.yaxis.set_major_formatter(NullFormatter())\nplt.axis(\"tight\")\n\nplt.show()"
18+
"# Authors: The scikit-learn developers\n# SPDX-License-Identifier: BSD-3-Clause\n\nfrom time import time\n\nimport matplotlib.pyplot as plt\n\n# Unused but required import for doing 3d projections with matplotlib < 3.2\nimport mpl_toolkits.mplot3d # noqa: F401\nimport numpy as np\nfrom matplotlib.ticker import NullFormatter\n\nfrom sklearn import manifold\nfrom sklearn.utils import check_random_state\n\n# Variables for manifold learning.\nn_neighbors = 10\nn_samples = 1000\n\n# Create our sphere.\nrandom_state = check_random_state(0)\np = random_state.rand(n_samples) * (2 * np.pi - 0.55)\nt = random_state.rand(n_samples) * np.pi\n\n# Sever the poles from the sphere.\nindices = (t < (np.pi - (np.pi / 8))) & (t > (np.pi / 8))\ncolors = p[indices]\nx, y, z = (\n np.sin(t[indices]) * np.cos(p[indices]),\n np.sin(t[indices]) * np.sin(p[indices]),\n np.cos(t[indices]),\n)\n\n# Plot our dataset.\nfig = plt.figure(figsize=(15, 8))\nplt.suptitle(\n \"Manifold Learning with %i points, %i neighbors\" % (1000, n_neighbors), fontsize=14\n)\n\nax = fig.add_subplot(251, projection=\"3d\")\nax.scatter(x, y, z, c=p[indices], cmap=plt.cm.rainbow)\nax.view_init(40, -10)\n\nsphere_data = np.array([x, y, z]).T\n\n# Perform Locally Linear Embedding Manifold learning\nmethods = [\"standard\", \"ltsa\", \"hessian\", \"modified\"]\nlabels = [\"LLE\", \"LTSA\", \"Hessian LLE\", \"Modified LLE\"]\n\nfor i, method in enumerate(methods):\n t0 = time()\n trans_data = (\n manifold.LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=method, random_state=42\n )\n .fit_transform(sphere_data)\n .T\n )\n t1 = time()\n print(\"%s: %.2g sec\" % (methods[i], t1 - t0))\n\n ax = fig.add_subplot(252 + i)\n plt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\n plt.title(\"%s (%.2g sec)\" % (labels[i], t1 - t0))\n ax.xaxis.set_major_formatter(NullFormatter())\n ax.yaxis.set_major_formatter(NullFormatter())\n plt.axis(\"tight\")\n\n# Perform Isomap Manifold learning.\nt0 = time()\ntrans_data = (\n manifold.Isomap(n_neighbors=n_neighbors, n_components=2)\n .fit_transform(sphere_data)\n .T\n)\nt1 = time()\nprint(\"%s: %.2g sec\" % (\"ISO\", t1 - t0))\n\nax = fig.add_subplot(257)\nplt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\nplt.title(\"%s (%.2g sec)\" % (\"Isomap\", t1 - t0))\nax.xaxis.set_major_formatter(NullFormatter())\nax.yaxis.set_major_formatter(NullFormatter())\nplt.axis(\"tight\")\n\n# Perform Multi-dimensional scaling.\nt0 = time()\nmds = manifold.MDS(2, max_iter=100, n_init=1, random_state=42)\ntrans_data = mds.fit_transform(sphere_data).T\nt1 = time()\nprint(\"MDS: %.2g sec\" % (t1 - t0))\n\nax = fig.add_subplot(258)\nplt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\nplt.title(\"MDS (%.2g sec)\" % (t1 - t0))\nax.xaxis.set_major_formatter(NullFormatter())\nax.yaxis.set_major_formatter(NullFormatter())\nplt.axis(\"tight\")\n\n# Perform Spectral Embedding.\nt0 = time()\nse = manifold.SpectralEmbedding(\n n_components=2, n_neighbors=n_neighbors, random_state=42\n)\ntrans_data = se.fit_transform(sphere_data).T\nt1 = time()\nprint(\"Spectral Embedding: %.2g sec\" % (t1 - t0))\n\nax = fig.add_subplot(259)\nplt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\nplt.title(\"Spectral Embedding (%.2g sec)\" % (t1 - t0))\nax.xaxis.set_major_formatter(NullFormatter())\nax.yaxis.set_major_formatter(NullFormatter())\nplt.axis(\"tight\")\n\n# Perform t-distributed stochastic neighbor embedding.\nt0 = time()\ntsne = manifold.TSNE(n_components=2, random_state=0)\ntrans_data = tsne.fit_transform(sphere_data).T\nt1 = time()\nprint(\"t-SNE: %.2g sec\" % (t1 - t0))\n\nax = fig.add_subplot(2, 5, 10)\nplt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow)\nplt.title(\"t-SNE (%.2g sec)\" % (t1 - t0))\nax.xaxis.set_major_formatter(NullFormatter())\nax.yaxis.set_major_formatter(NullFormatter())\nplt.axis(\"tight\")\n\nplt.show()"
1919
]
2020
}
2121
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/6953689dfdc5dd401dda89604bbdaefb/plot_time_series_lagged_features.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
},
286286
"outputs": [],
287287
"source": [
288-
"quantile_list = [0.05, 0.5, 0.95]\n\nfor quantile in quantile_list:\n model = HistGradientBoostingRegressor(loss=\"quantile\", quantile=quantile)\n cv_results = cross_validate(\n model,\n X,\n y,\n cv=ts_cv,\n scoring=scoring,\n n_jobs=2,\n )\n time = cv_results[\"fit_time\"]\n scores[\"fit_time\"].append(f\"{time.mean():.2f} \u00b1 {time.std():.2f} s\")\n\n scores[\"loss\"].append(f\"quantile {int(quantile*100)}\")\n for key, value in cv_results.items():\n if key.startswith(\"test_\"):\n metric = key.split(\"test_\")[1]\n scores = consolidate_scores(cv_results, scores, metric)\n\nscores_df = pl.DataFrame(scores)\nscores_df"
288+
"quantile_list = [0.05, 0.5, 0.95]\n\nfor quantile in quantile_list:\n model = HistGradientBoostingRegressor(loss=\"quantile\", quantile=quantile)\n cv_results = cross_validate(\n model,\n X,\n y,\n cv=ts_cv,\n scoring=scoring,\n n_jobs=2,\n )\n time = cv_results[\"fit_time\"]\n scores[\"fit_time\"].append(f\"{time.mean():.2f} \u00b1 {time.std():.2f} s\")\n\n scores[\"loss\"].append(f\"quantile {int(quantile * 100)}\")\n for key, value in cv_results.items():\n if key.startswith(\"test_\"):\n metric = key.split(\"test_\")[1]\n scores = consolidate_scores(cv_results, scores, metric)\n\nscores_df = pl.DataFrame(scores)\nscores_df"
289289
]
290290
},
291291
{

dev/_downloads/69878e8e2864920aa874c5a68cecf1d3/plot_species_distribution_modeling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def create_species_bunch(species_name, train, test, coverages, xgrid, ygrid):
109109

110110

111111
def plot_species_distribution(
112-
species=("bradypus_variegatus_0", "microryzomys_minutus_0")
112+
species=("bradypus_variegatus_0", "microryzomys_minutus_0"),
113113
):
114114
"""
115115
Plot the species distribution.
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/7aa7f72ae5f3350402429f7a9851b596/plot_mahalanobis_distances.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
Proceedings of the National Academy of Sciences of the United States
6161
of America, 17, 684-688.
6262
63-
""" # noqa: E501
63+
"""
6464

6565
# Authors: The scikit-learn developers
6666
# SPDX-License-Identifier: BSD-3-Clause
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/7ff1697c60d48929305821f39296dbb9/plot_document_classification_20newsgroups.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
"cell_type": "markdown",
192192
"metadata": {},
193193
"source": [
194-
"We now train and test the datasets with 8 different classification models and\nget performance results for each model. The goal of this study is to highlight\nthe computation/accuracy tradeoffs of different types of classifiers for\nsuch a multi-class text classification problem.\n\nNotice that the most important hyperparameters values were tuned using a grid\nsearch procedure not shown in this notebook for the sake of simplicity. See\nthe example script\n`sphx_glr_auto_examples_model_selection_plot_grid_search_text_feature_extraction.py` # noqa: E501\nfor a demo on how such tuning can be done.\n\n"
194+
"We now train and test the datasets with 8 different classification models and\nget performance results for each model. The goal of this study is to highlight\nthe computation/accuracy tradeoffs of different types of classifiers for\nsuch a multi-class text classification problem.\n\nNotice that the most important hyperparameters values were tuned using a grid\nsearch procedure not shown in this notebook for the sake of simplicity. See\nthe example script\n`sphx_glr_auto_examples_model_selection_plot_grid_search_text_feature_extraction.py`\nfor a demo on how such tuning can be done.\n\n"
195195
]
196196
},
197197
{
Binary file not shown.

dev/_downloads/80fef09514fd851560e999a5b7daa303/plot_roc.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@
152152
#
153153
# We can briefly demo the effect of :func:`numpy.ravel`:
154154

155-
print(f"y_score:\n{y_score[0:2,:]}")
155+
print(f"y_score:\n{y_score[0:2, :]}")
156156
print()
157-
print(f"y_score.ravel():\n{y_score[0:2,:].ravel()}")
157+
print(f"y_score.ravel():\n{y_score[0:2, :].ravel()}")
158158

159159
# %%
160160
# In a multi-class classification setup with highly imbalanced classes,
@@ -359,7 +359,7 @@
359359
plt.plot(
360360
fpr_grid,
361361
mean_tpr[ix],
362-
label=f"Mean {label_a} vs {label_b} (AUC = {mean_score :.2f})",
362+
label=f"Mean {label_a} vs {label_b} (AUC = {mean_score:.2f})",
363363
linestyle=":",
364364
linewidth=4,
365365
)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/86c888008757148890daaf43d664fa71/plot_tweedie_regression_insurance_claims.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,9 @@ def score_estimator(
606606
"predicted, frequency*severity model": np.sum(
607607
exposure * glm_freq.predict(X) * glm_sev.predict(X)
608608
),
609-
"predicted, tweedie, power=%.2f"
610-
% glm_pure_premium.power: np.sum(exposure * glm_pure_premium.predict(X)),
609+
"predicted, tweedie, power=%.2f" % glm_pure_premium.power: np.sum(
610+
exposure * glm_pure_premium.predict(X)
611+
),
611612
}
612613
)
613614

Binary file not shown.

dev/_downloads/883c6b4b0cc369a10ddb336c09a9e4dd/plot_likelihood_ratios.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class proportion than the target application.
4040
from sklearn.datasets import make_classification
4141

4242
X, y = make_classification(n_samples=10_000, weights=[0.9, 0.1], random_state=0)
43-
print(f"Percentage of people carrying the disease: {100*y.mean():.2f}%")
43+
print(f"Percentage of people carrying the disease: {100 * y.mean():.2f}%")
4444

4545
# %%
4646
# A machine learning model is built to diagnose if a person with some given
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)