Skip to content

Commit 05f0f41

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 972e17fe1aa12d481b120ad4a3dc076bae736931
1 parent a2d3341 commit 05f0f41

File tree

1,272 files changed

+6157
-6172
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,272 files changed

+6157
-6172
lines changed
Binary file not shown.

dev/_downloads/1f682002d8b68c290d9d03599368e83d/plot_lasso_coordinate_descent_path.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from itertools import cycle
1717

1818
import matplotlib.pyplot as plt
19-
import numpy as np
2019

2120
from sklearn import datasets
2221
from sklearn.linear_model import enet_path, lasso_path
@@ -49,41 +48,37 @@
4948

5049
plt.figure(1)
5150
colors = cycle(["b", "r", "g", "c", "k"])
52-
neg_log_alphas_lasso = -np.log10(alphas_lasso)
53-
neg_log_alphas_enet = -np.log10(alphas_enet)
5451
for coef_l, coef_e, c in zip(coefs_lasso, coefs_enet, colors):
55-
l1 = plt.plot(neg_log_alphas_lasso, coef_l, c=c)
56-
l2 = plt.plot(neg_log_alphas_enet, coef_e, linestyle="--", c=c)
52+
l1 = plt.semilogx(alphas_lasso, coef_l, c=c)
53+
l2 = plt.semilogx(alphas_enet, coef_e, linestyle="--", c=c)
5754

58-
plt.xlabel("-Log(alpha)")
55+
plt.xlabel("alpha")
5956
plt.ylabel("coefficients")
6057
plt.title("Lasso and Elastic-Net Paths")
61-
plt.legend((l1[-1], l2[-1]), ("Lasso", "Elastic-Net"), loc="lower left")
58+
plt.legend((l1[-1], l2[-1]), ("Lasso", "Elastic-Net"), loc="lower right")
6259
plt.axis("tight")
6360

6461

6562
plt.figure(2)
66-
neg_log_alphas_positive_lasso = -np.log10(alphas_positive_lasso)
6763
for coef_l, coef_pl, c in zip(coefs_lasso, coefs_positive_lasso, colors):
68-
l1 = plt.plot(neg_log_alphas_lasso, coef_l, c=c)
69-
l2 = plt.plot(neg_log_alphas_positive_lasso, coef_pl, linestyle="--", c=c)
64+
l1 = plt.semilogy(alphas_lasso, coef_l, c=c)
65+
l2 = plt.semilogy(alphas_positive_lasso, coef_pl, linestyle="--", c=c)
7066

71-
plt.xlabel("-Log(alpha)")
67+
plt.xlabel("alpha")
7268
plt.ylabel("coefficients")
7369
plt.title("Lasso and positive Lasso")
74-
plt.legend((l1[-1], l2[-1]), ("Lasso", "positive Lasso"), loc="lower left")
70+
plt.legend((l1[-1], l2[-1]), ("Lasso", "positive Lasso"), loc="lower right")
7571
plt.axis("tight")
7672

7773

7874
plt.figure(3)
79-
neg_log_alphas_positive_enet = -np.log10(alphas_positive_enet)
8075
for coef_e, coef_pe, c in zip(coefs_enet, coefs_positive_enet, colors):
81-
l1 = plt.plot(neg_log_alphas_enet, coef_e, c=c)
82-
l2 = plt.plot(neg_log_alphas_positive_enet, coef_pe, linestyle="--", c=c)
76+
l1 = plt.semilogx(alphas_enet, coef_e, c=c)
77+
l2 = plt.semilogx(alphas_positive_enet, coef_pe, linestyle="--", c=c)
8378

84-
plt.xlabel("-Log(alpha)")
79+
plt.xlabel("alpha")
8580
plt.ylabel("coefficients")
8681
plt.title("Elastic-Net and positive Elastic-Net")
87-
plt.legend((l1[-1], l2[-1]), ("Elastic-Net", "positive Elastic-Net"), loc="lower left")
82+
plt.legend((l1[-1], l2[-1]), ("Elastic-Net", "positive Elastic-Net"), loc="lower right")
8883
plt.axis("tight")
8984
plt.show()

dev/_downloads/4c4c075dc14e39d30d982d0b2818ea95/plot_lasso_coordinate_descent_path.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"# Author: Alexandre Gramfort <[email protected]>\n# SPDX-License-Identifier: BSD-3-Clause\n\nfrom itertools import cycle\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn import datasets\nfrom sklearn.linear_model import enet_path, lasso_path\n\nX, y = datasets.load_diabetes(return_X_y=True)\n\n\nX /= X.std(axis=0) # Standardize data (easier to set the l1_ratio parameter)\n\n# Compute paths\n\neps = 5e-3 # the smaller it is the longer is the path\n\nprint(\"Computing regularization path using the lasso...\")\nalphas_lasso, coefs_lasso, _ = lasso_path(X, y, eps=eps)\n\nprint(\"Computing regularization path using the positive lasso...\")\nalphas_positive_lasso, coefs_positive_lasso, _ = lasso_path(\n X, y, eps=eps, positive=True\n)\nprint(\"Computing regularization path using the elastic net...\")\nalphas_enet, coefs_enet, _ = enet_path(X, y, eps=eps, l1_ratio=0.8)\n\nprint(\"Computing regularization path using the positive elastic net...\")\nalphas_positive_enet, coefs_positive_enet, _ = enet_path(\n X, y, eps=eps, l1_ratio=0.8, positive=True\n)\n\n# Display results\n\nplt.figure(1)\ncolors = cycle([\"b\", \"r\", \"g\", \"c\", \"k\"])\nneg_log_alphas_lasso = -np.log10(alphas_lasso)\nneg_log_alphas_enet = -np.log10(alphas_enet)\nfor coef_l, coef_e, c in zip(coefs_lasso, coefs_enet, colors):\n l1 = plt.plot(neg_log_alphas_lasso, coef_l, c=c)\n l2 = plt.plot(neg_log_alphas_enet, coef_e, linestyle=\"--\", c=c)\n\nplt.xlabel(\"-Log(alpha)\")\nplt.ylabel(\"coefficients\")\nplt.title(\"Lasso and Elastic-Net Paths\")\nplt.legend((l1[-1], l2[-1]), (\"Lasso\", \"Elastic-Net\"), loc=\"lower left\")\nplt.axis(\"tight\")\n\n\nplt.figure(2)\nneg_log_alphas_positive_lasso = -np.log10(alphas_positive_lasso)\nfor coef_l, coef_pl, c in zip(coefs_lasso, coefs_positive_lasso, colors):\n l1 = plt.plot(neg_log_alphas_lasso, coef_l, c=c)\n l2 = plt.plot(neg_log_alphas_positive_lasso, coef_pl, linestyle=\"--\", c=c)\n\nplt.xlabel(\"-Log(alpha)\")\nplt.ylabel(\"coefficients\")\nplt.title(\"Lasso and positive Lasso\")\nplt.legend((l1[-1], l2[-1]), (\"Lasso\", \"positive Lasso\"), loc=\"lower left\")\nplt.axis(\"tight\")\n\n\nplt.figure(3)\nneg_log_alphas_positive_enet = -np.log10(alphas_positive_enet)\nfor coef_e, coef_pe, c in zip(coefs_enet, coefs_positive_enet, colors):\n l1 = plt.plot(neg_log_alphas_enet, coef_e, c=c)\n l2 = plt.plot(neg_log_alphas_positive_enet, coef_pe, linestyle=\"--\", c=c)\n\nplt.xlabel(\"-Log(alpha)\")\nplt.ylabel(\"coefficients\")\nplt.title(\"Elastic-Net and positive Elastic-Net\")\nplt.legend((l1[-1], l2[-1]), (\"Elastic-Net\", \"positive Elastic-Net\"), loc=\"lower left\")\nplt.axis(\"tight\")\nplt.show()"
18+
"# Author: Alexandre Gramfort <[email protected]>\n# SPDX-License-Identifier: BSD-3-Clause\n\nfrom itertools import cycle\n\nimport matplotlib.pyplot as plt\n\nfrom sklearn import datasets\nfrom sklearn.linear_model import enet_path, lasso_path\n\nX, y = datasets.load_diabetes(return_X_y=True)\n\n\nX /= X.std(axis=0) # Standardize data (easier to set the l1_ratio parameter)\n\n# Compute paths\n\neps = 5e-3 # the smaller it is the longer is the path\n\nprint(\"Computing regularization path using the lasso...\")\nalphas_lasso, coefs_lasso, _ = lasso_path(X, y, eps=eps)\n\nprint(\"Computing regularization path using the positive lasso...\")\nalphas_positive_lasso, coefs_positive_lasso, _ = lasso_path(\n X, y, eps=eps, positive=True\n)\nprint(\"Computing regularization path using the elastic net...\")\nalphas_enet, coefs_enet, _ = enet_path(X, y, eps=eps, l1_ratio=0.8)\n\nprint(\"Computing regularization path using the positive elastic net...\")\nalphas_positive_enet, coefs_positive_enet, _ = enet_path(\n X, y, eps=eps, l1_ratio=0.8, positive=True\n)\n\n# Display results\n\nplt.figure(1)\ncolors = cycle([\"b\", \"r\", \"g\", \"c\", \"k\"])\nfor coef_l, coef_e, c in zip(coefs_lasso, coefs_enet, colors):\n l1 = plt.semilogx(alphas_lasso, coef_l, c=c)\n l2 = plt.semilogx(alphas_enet, coef_e, linestyle=\"--\", c=c)\n\nplt.xlabel(\"alpha\")\nplt.ylabel(\"coefficients\")\nplt.title(\"Lasso and Elastic-Net Paths\")\nplt.legend((l1[-1], l2[-1]), (\"Lasso\", \"Elastic-Net\"), loc=\"lower right\")\nplt.axis(\"tight\")\n\n\nplt.figure(2)\nfor coef_l, coef_pl, c in zip(coefs_lasso, coefs_positive_lasso, colors):\n l1 = plt.semilogy(alphas_lasso, coef_l, c=c)\n l2 = plt.semilogy(alphas_positive_lasso, coef_pl, linestyle=\"--\", c=c)\n\nplt.xlabel(\"alpha\")\nplt.ylabel(\"coefficients\")\nplt.title(\"Lasso and positive Lasso\")\nplt.legend((l1[-1], l2[-1]), (\"Lasso\", \"positive Lasso\"), loc=\"lower right\")\nplt.axis(\"tight\")\n\n\nplt.figure(3)\nfor coef_e, coef_pe, c in zip(coefs_enet, coefs_positive_enet, colors):\n l1 = plt.semilogx(alphas_enet, coef_e, c=c)\n l2 = plt.semilogx(alphas_positive_enet, coef_pe, linestyle=\"--\", c=c)\n\nplt.xlabel(\"alpha\")\nplt.ylabel(\"coefficients\")\nplt.title(\"Elastic-Net and positive Elastic-Net\")\nplt.legend((l1[-1], l2[-1]), (\"Elastic-Net\", \"positive Elastic-Net\"), loc=\"lower right\")\nplt.axis(\"tight\")\nplt.show()"
1919
]
2020
}
2121
],
Binary file not shown.

dev/_downloads/scikit-learn-docs.zip

-20.5 KB
Binary file not shown.
-376 Bytes
-1017 Bytes
-125 Bytes
-221 Bytes
-16 Bytes
193 Bytes
13 Bytes
-1.48 KB
167 Bytes
94 Bytes
-110 Bytes
-124 Bytes
114 Bytes
1.04 KB
-3.29 KB
-853 Bytes
-88 Bytes
-9 Bytes
-43 Bytes
203 Bytes
85 Bytes
-87 Bytes
140 Bytes
6 Bytes
8 Bytes
116 Bytes
-85 Bytes
684 Bytes
323 Bytes
-155 Bytes
6 Bytes
-71 Bytes
-55 Bytes
-19 Bytes

dev/_sources/auto_examples/applications/plot_cyclical_feature_engineering.rst.txt

Lines changed: 1 addition & 1 deletion

dev/_sources/auto_examples/applications/plot_digits_denoising.rst.txt

Lines changed: 1 addition & 1 deletion

dev/_sources/auto_examples/applications/plot_face_recognition.rst.txt

Lines changed: 5 additions & 5 deletions

dev/_sources/auto_examples/applications/plot_model_complexity_influence.rst.txt

Lines changed: 15 additions & 15 deletions

0 commit comments

Comments
 (0)