Skip to content

Commit 9045d30

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 91f02270a8f49e3e52882dc0fa634eff4d138fc8
1 parent 9b7b953 commit 9045d30

File tree

1,363 files changed

+4611
-4578
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,363 files changed

+4611
-4578
lines changed
Binary file not shown.

Diff for: dev/_downloads/14f620cd922ca2c9a39ae5784034dd0d/plot_lda.py

+3
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,23 @@ def generate_data(n_samples, n_features):
7171
linewidth=2,
7272
label="Linear Discriminant Analysis with Ledoit Wolf",
7373
color="navy",
74+
linestyle="dashed",
7475
)
7576
plt.plot(
7677
features_samples_ratio,
7778
acc_clf2,
7879
linewidth=2,
7980
label="Linear Discriminant Analysis",
8081
color="gold",
82+
linestyle="solid",
8183
)
8284
plt.plot(
8385
features_samples_ratio,
8486
acc_clf3,
8587
linewidth=2,
8688
label="Linear Discriminant Analysis with OAS",
8789
color="red",
90+
linestyle="dotted",
8891
)
8992

9093
plt.xlabel("n_features / n_samples")
Binary file not shown.

Diff for: dev/_downloads/acc912c1f80e1cb0e32675b5f7686075/plot_lda.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"outputs": [],
2828
"source": [
29-
"import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn.datasets import make_blobs\nfrom sklearn.discriminant_analysis import LinearDiscriminantAnalysis\nfrom sklearn.covariance import OAS\n\n\nn_train = 20 # samples for training\nn_test = 200 # samples for testing\nn_averages = 50 # how often to repeat classification\nn_features_max = 75 # maximum number of features\nstep = 4 # step size for the calculation\n\n\ndef generate_data(n_samples, n_features):\n \"\"\"Generate random blob-ish data with noisy features.\n\n This returns an array of input data with shape `(n_samples, n_features)`\n and an array of `n_samples` target labels.\n\n Only one feature contains discriminative information, the other features\n contain only noise.\n \"\"\"\n X, y = make_blobs(n_samples=n_samples, n_features=1, centers=[[-2], [2]])\n\n # add non-discriminative features\n if n_features > 1:\n X = np.hstack([X, np.random.randn(n_samples, n_features - 1)])\n return X, y\n\n\nacc_clf1, acc_clf2, acc_clf3 = [], [], []\nn_features_range = range(1, n_features_max + 1, step)\nfor n_features in n_features_range:\n score_clf1, score_clf2, score_clf3 = 0, 0, 0\n for _ in range(n_averages):\n X, y = generate_data(n_train, n_features)\n\n clf1 = LinearDiscriminantAnalysis(solver=\"lsqr\", shrinkage=\"auto\").fit(X, y)\n clf2 = LinearDiscriminantAnalysis(solver=\"lsqr\", shrinkage=None).fit(X, y)\n oa = OAS(store_precision=False, assume_centered=False)\n clf3 = LinearDiscriminantAnalysis(solver=\"lsqr\", covariance_estimator=oa).fit(\n X, y\n )\n\n X, y = generate_data(n_test, n_features)\n score_clf1 += clf1.score(X, y)\n score_clf2 += clf2.score(X, y)\n score_clf3 += clf3.score(X, y)\n\n acc_clf1.append(score_clf1 / n_averages)\n acc_clf2.append(score_clf2 / n_averages)\n acc_clf3.append(score_clf3 / n_averages)\n\nfeatures_samples_ratio = np.array(n_features_range) / n_train\n\nplt.plot(\n features_samples_ratio,\n acc_clf1,\n linewidth=2,\n label=\"Linear Discriminant Analysis with Ledoit Wolf\",\n color=\"navy\",\n)\nplt.plot(\n features_samples_ratio,\n acc_clf2,\n linewidth=2,\n label=\"Linear Discriminant Analysis\",\n color=\"gold\",\n)\nplt.plot(\n features_samples_ratio,\n acc_clf3,\n linewidth=2,\n label=\"Linear Discriminant Analysis with OAS\",\n color=\"red\",\n)\n\nplt.xlabel(\"n_features / n_samples\")\nplt.ylabel(\"Classification accuracy\")\n\nplt.legend(loc=3, prop={\"size\": 12})\nplt.suptitle(\n \"Linear Discriminant Analysis vs. \"\n + \"\\n\"\n + \"Shrinkage Linear Discriminant Analysis vs. \"\n + \"\\n\"\n + \"OAS Linear Discriminant Analysis (1 discriminative feature)\"\n)\nplt.show()"
29+
"import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn.datasets import make_blobs\nfrom sklearn.discriminant_analysis import LinearDiscriminantAnalysis\nfrom sklearn.covariance import OAS\n\n\nn_train = 20 # samples for training\nn_test = 200 # samples for testing\nn_averages = 50 # how often to repeat classification\nn_features_max = 75 # maximum number of features\nstep = 4 # step size for the calculation\n\n\ndef generate_data(n_samples, n_features):\n \"\"\"Generate random blob-ish data with noisy features.\n\n This returns an array of input data with shape `(n_samples, n_features)`\n and an array of `n_samples` target labels.\n\n Only one feature contains discriminative information, the other features\n contain only noise.\n \"\"\"\n X, y = make_blobs(n_samples=n_samples, n_features=1, centers=[[-2], [2]])\n\n # add non-discriminative features\n if n_features > 1:\n X = np.hstack([X, np.random.randn(n_samples, n_features - 1)])\n return X, y\n\n\nacc_clf1, acc_clf2, acc_clf3 = [], [], []\nn_features_range = range(1, n_features_max + 1, step)\nfor n_features in n_features_range:\n score_clf1, score_clf2, score_clf3 = 0, 0, 0\n for _ in range(n_averages):\n X, y = generate_data(n_train, n_features)\n\n clf1 = LinearDiscriminantAnalysis(solver=\"lsqr\", shrinkage=\"auto\").fit(X, y)\n clf2 = LinearDiscriminantAnalysis(solver=\"lsqr\", shrinkage=None).fit(X, y)\n oa = OAS(store_precision=False, assume_centered=False)\n clf3 = LinearDiscriminantAnalysis(solver=\"lsqr\", covariance_estimator=oa).fit(\n X, y\n )\n\n X, y = generate_data(n_test, n_features)\n score_clf1 += clf1.score(X, y)\n score_clf2 += clf2.score(X, y)\n score_clf3 += clf3.score(X, y)\n\n acc_clf1.append(score_clf1 / n_averages)\n acc_clf2.append(score_clf2 / n_averages)\n acc_clf3.append(score_clf3 / n_averages)\n\nfeatures_samples_ratio = np.array(n_features_range) / n_train\n\nplt.plot(\n features_samples_ratio,\n acc_clf1,\n linewidth=2,\n label=\"Linear Discriminant Analysis with Ledoit Wolf\",\n color=\"navy\",\n linestyle=\"dashed\",\n)\nplt.plot(\n features_samples_ratio,\n acc_clf2,\n linewidth=2,\n label=\"Linear Discriminant Analysis\",\n color=\"gold\",\n linestyle=\"solid\",\n)\nplt.plot(\n features_samples_ratio,\n acc_clf3,\n linewidth=2,\n label=\"Linear Discriminant Analysis with OAS\",\n color=\"red\",\n linestyle=\"dotted\",\n)\n\nplt.xlabel(\"n_features / n_samples\")\nplt.ylabel(\"Classification accuracy\")\n\nplt.legend(loc=3, prop={\"size\": 12})\nplt.suptitle(\n \"Linear Discriminant Analysis vs. \"\n + \"\\n\"\n + \"Shrinkage Linear Discriminant Analysis vs. \"\n + \"\\n\"\n + \"OAS Linear Discriminant Analysis (1 discriminative feature)\"\n)\nplt.show()"
3030
]
3131
}
3232
],

Diff for: dev/_downloads/scikit-learn-docs.zip

-5.91 KB
Binary file not shown.
-3 Bytes
48 Bytes
-15 Bytes
161 Bytes
-179 Bytes
148 Bytes
129 Bytes
65 Bytes

Diff for: dev/_images/sphx_glr_plot_all_scaling_006.png

0 Bytes

Diff for: dev/_images/sphx_glr_plot_all_scaling_007.png

0 Bytes

Diff for: dev/_images/sphx_glr_plot_anomaly_comparison_001.png

-236 Bytes
-11 Bytes

Diff for: dev/_images/sphx_glr_plot_ard_001.png

-2 Bytes

Diff for: dev/_images/sphx_glr_plot_ard_thumb.png

14 Bytes
-215 Bytes
-93 Bytes
4 Bytes
-4 Bytes
25 Bytes
2 Bytes

Diff for: dev/_images/sphx_glr_plot_cluster_comparison_001.png

-1.09 KB
-129 Bytes

Diff for: dev/_images/sphx_glr_plot_coin_segmentation_001.png

2 Bytes

Diff for: dev/_images/sphx_glr_plot_coin_segmentation_002.png

-83 Bytes

Diff for: dev/_images/sphx_glr_plot_coin_segmentation_003.png

-19 Bytes
13 Bytes

Diff for: dev/_images/sphx_glr_plot_color_quantization_003.png

115 Bytes
-331 Bytes
97 Bytes
-634 Bytes
624 Bytes

Diff for: dev/_images/sphx_glr_plot_compare_methods_002.png

171 Bytes

Diff for: dev/_images/sphx_glr_plot_dict_face_patches_001.png

26 Bytes
91 Bytes

Diff for: dev/_images/sphx_glr_plot_digits_pipe_001.png

16 Bytes

Diff for: dev/_images/sphx_glr_plot_digits_pipe_thumb.png

10 Bytes
-107 Bytes
-186 Bytes

Diff for: dev/_images/sphx_glr_plot_face_recognition_003.png

2 Bytes
0 Bytes
3 Bytes
205 Bytes
7 Bytes
0 Bytes
-2 Bytes
2 Bytes
-1 Bytes
26 Bytes
-111 Bytes
19 Bytes

Diff for: dev/_images/sphx_glr_plot_forest_iris_001.png

-464 Bytes

Diff for: dev/_images/sphx_glr_plot_forest_iris_thumb.png

-204 Bytes

Diff for: dev/_images/sphx_glr_plot_gmm_init_001.png

70 Bytes

Diff for: dev/_images/sphx_glr_plot_gmm_init_thumb.png

11 Bytes

Diff for: dev/_images/sphx_glr_plot_gmm_pdf_001.png

-5 Bytes

Diff for: dev/_images/sphx_glr_plot_gmm_pdf_thumb.png

0 Bytes

Diff for: dev/_images/sphx_glr_plot_gpr_noisy_003.png

-76 Bytes

Diff for: dev/_images/sphx_glr_plot_gpr_noisy_005.png

-24 Bytes
-7 Bytes
-8 Bytes
1.71 KB
12 Bytes
742 Bytes
1.54 KB
460 Bytes
-362 Bytes
-28 Bytes
-76 Bytes
124 Bytes
164 Bytes
67 Bytes

Diff for: dev/_images/sphx_glr_plot_image_denoising_002.png

48 Bytes

Diff for: dev/_images/sphx_glr_plot_image_denoising_003.png

246 Bytes

Diff for: dev/_images/sphx_glr_plot_image_denoising_004.png

2 Bytes

Diff for: dev/_images/sphx_glr_plot_image_denoising_005.png

-32 Bytes

Diff for: dev/_images/sphx_glr_plot_iris_dtc_001.png

-62 Bytes

Diff for: dev/_images/sphx_glr_plot_iris_dtc_002.png

-41 Bytes

Diff for: dev/_images/sphx_glr_plot_iris_dtc_thumb.png

-4 Bytes

Diff for: dev/_images/sphx_glr_plot_iris_exercise_001.png

-14 Bytes

Diff for: dev/_images/sphx_glr_plot_iris_exercise_003.png

0 Bytes

Diff for: dev/_images/sphx_glr_plot_iris_exercise_thumb.png

4 Bytes
-481 Bytes
-3 Bytes

Diff for: dev/_images/sphx_glr_plot_kernel_pca_003.png

-21 Bytes
-167 Bytes
578 Bytes
21 Bytes
-16 Bytes
-57 Bytes
105 Bytes

Diff for: dev/_images/sphx_glr_plot_lda_001.png

-636 Bytes

Diff for: dev/_images/sphx_glr_plot_lda_thumb.png

-402 Bytes

Diff for: dev/_images/sphx_glr_plot_learning_curve_001.png

-749 Bytes

Diff for: dev/_images/sphx_glr_plot_learning_curve_thumb.png

171 Bytes

Diff for: dev/_images/sphx_glr_plot_linkage_comparison_001.png

-998 Bytes
-6 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_003.png

-26 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_004.png

19 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_005.png

-70 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_006.png

7 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_007.png

-295 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_008.png

-142 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_009.png

73 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_010.png

14 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_011.png

-50 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_012.png

-6 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_013.png

235 Bytes

Diff for: dev/_images/sphx_glr_plot_lle_digits_014.png

16 Bytes

Diff for: dev/_images/sphx_glr_plot_manifold_sphere_001.png

7 Bytes

Diff for: dev/_images/sphx_glr_plot_manifold_sphere_thumb.png

-31 Bytes

Diff for: dev/_images/sphx_glr_plot_mini_batch_kmeans_001.png

118 Bytes
-1 Bytes

Diff for: dev/_images/sphx_glr_plot_mlp_alpha_001.png

-820 Bytes

Diff for: dev/_images/sphx_glr_plot_mlp_alpha_thumb.png

-53 Bytes
-1.47 KB
1.68 KB
-1.82 KB
-1017 Bytes

Diff for: dev/_images/sphx_glr_plot_multilabel_001.png

12 Bytes

Diff for: dev/_images/sphx_glr_plot_multilabel_thumb.png

-7 Bytes
-2 Bytes
0 Bytes

Diff for: dev/_images/sphx_glr_plot_nca_dim_reduction_003.png

-26 Bytes
737 Bytes
-443 Bytes
59 Bytes

Diff for: dev/_images/sphx_glr_plot_prediction_latency_001.png

-1.71 KB

Diff for: dev/_images/sphx_glr_plot_prediction_latency_002.png

-1.62 KB

Diff for: dev/_images/sphx_glr_plot_prediction_latency_003.png

72 Bytes

Diff for: dev/_images/sphx_glr_plot_prediction_latency_004.png

-592 Bytes
-559 Bytes

Diff for: dev/_images/sphx_glr_plot_random_dataset_001.png

468 Bytes

Diff for: dev/_images/sphx_glr_plot_random_dataset_thumb.png

247 Bytes
0 Bytes
-13 Bytes
-212 Bytes
-336 Bytes
-7 Bytes
81 Bytes
57 Bytes
-49 Bytes
-194 Bytes
147 Bytes
0 Bytes
20 Bytes

Diff for: dev/_images/sphx_glr_plot_sgd_early_stopping_001.png

4.41 KB
2.31 KB
18 Bytes
-1 Bytes

Diff for: dev/_images/sphx_glr_plot_sparse_coding_001.png

15 Bytes

Diff for: dev/_images/sphx_glr_plot_sparse_coding_thumb.png

-12 Bytes

Diff for: dev/_images/sphx_glr_plot_sparse_cov_001.png

109 Bytes

Diff for: dev/_images/sphx_glr_plot_sparse_cov_002.png

-489 Bytes

Diff for: dev/_images/sphx_glr_plot_sparse_cov_thumb.png

9 Bytes

Diff for: dev/_images/sphx_glr_plot_stack_predictors_001.png

-781 Bytes

Diff for: dev/_images/sphx_glr_plot_stack_predictors_thumb.png

62 Bytes
-134 Bytes
-32 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_kernels_001.png

-13 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_kernels_thumb.png

5 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_margin_001.png

-34 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_margin_002.png

9 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_margin_thumb.png

5 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_regression_001.png

-10 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_regression_thumb.png

-8 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_scale_c_001.png

-7 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_scale_c_thumb.png

0 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_tie_breaking_001.png

5 Bytes

Diff for: dev/_images/sphx_glr_plot_svm_tie_breaking_thumb.png

2 Bytes

Diff for: dev/_images/sphx_glr_plot_swissroll_002.png

-76 Bytes

Diff for: dev/_images/sphx_glr_plot_swissroll_004.png

64 Bytes

Diff for: dev/_images/sphx_glr_plot_t_sne_perplexity_001.png

-1.54 KB

Diff for: dev/_images/sphx_glr_plot_t_sne_perplexity_thumb.png

-972 Bytes

Diff for: dev/_images/sphx_glr_plot_theilsen_001.png

22 Bytes

Diff for: dev/_images/sphx_glr_plot_theilsen_002.png

34 Bytes

Diff for: dev/_images/sphx_glr_plot_theilsen_thumb.png

9 Bytes
-6 Bytes

Diff for: dev/_images/sphx_glr_plot_transformed_target_004.png

-63 Bytes
9 Bytes
4 Bytes
-10 Bytes

Diff for: dev/_sources/auto_examples/applications/plot_cyclical_feature_engineering.rst.txt

+1-1

Diff for: dev/_sources/auto_examples/applications/plot_digits_denoising.rst.txt

+1-1

Diff for: dev/_sources/auto_examples/applications/plot_face_recognition.rst.txt

+5-5

Diff for: dev/_sources/auto_examples/applications/plot_model_complexity_influence.rst.txt

+15-15

0 commit comments

Comments
 (0)