diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index abe14acc7778c..e8730b679a5d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.2.1 + rev: v0.5.1 hooks: - id: ruff args: ["--fix", "--output-format=full"] diff --git a/benchmarks/bench_kernel_pca_solvers_time_vs_n_components.py b/benchmarks/bench_kernel_pca_solvers_time_vs_n_components.py index 26789c173688f..a468f7b3e1abf 100644 --- a/benchmarks/bench_kernel_pca_solvers_time_vs_n_components.py +++ b/benchmarks/bench_kernel_pca_solvers_time_vs_n_components.py @@ -36,8 +36,6 @@ of components (this takes more time). """ -# Authors: Sylvain MARIE, Schneider Electric - import time import matplotlib.pyplot as plt diff --git a/benchmarks/bench_plot_parallel_pairwise.py b/benchmarks/bench_plot_parallel_pairwise.py index a6eb6c04bffab..5b7cf81f8fce4 100644 --- a/benchmarks/bench_plot_parallel_pairwise.py +++ b/benchmarks/bench_plot_parallel_pairwise.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import time import matplotlib.pyplot as plt diff --git a/examples/applications/plot_cyclical_feature_engineering.py b/examples/applications/plot_cyclical_feature_engineering.py index a23e98d331dc0..f7c561da48f8b 100644 --- a/examples/applications/plot_cyclical_feature_engineering.py +++ b/examples/applications/plot_cyclical_feature_engineering.py @@ -13,6 +13,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Data exploration on the Bike Sharing Demand dataset # --------------------------------------------------- diff --git a/examples/applications/plot_digits_denoising.py b/examples/applications/plot_digits_denoising.py index 9d4b0cae79d06..8ca31da6a74d2 100644 --- a/examples/applications/plot_digits_denoising.py +++ b/examples/applications/plot_digits_denoising.py @@ -21,8 +21,8 @@ """ -# Authors: Guillaume Lemaitre -# Licence: BSD 3 clause +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause # %% # Load the dataset via OpenML diff --git a/examples/applications/plot_face_recognition.py b/examples/applications/plot_face_recognition.py index 97a67fad52776..4ace1b81ef7a0 100644 --- a/examples/applications/plot_face_recognition.py +++ b/examples/applications/plot_face_recognition.py @@ -12,6 +12,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% from time import time diff --git a/examples/applications/plot_time_series_lagged_features.py b/examples/applications/plot_time_series_lagged_features.py index 2efc12acae276..edb27ade48007 100644 --- a/examples/applications/plot_time_series_lagged_features.py +++ b/examples/applications/plot_time_series_lagged_features.py @@ -15,6 +15,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Analyzing the Bike Sharing Demand dataset # ----------------------------------------- diff --git a/examples/bicluster/plot_bicluster_newsgroups.py b/examples/bicluster/plot_bicluster_newsgroups.py index 0fef820bb9f2a..d110f3e6de9c5 100644 --- a/examples/bicluster/plot_bicluster_newsgroups.py +++ b/examples/bicluster/plot_bicluster_newsgroups.py @@ -23,6 +23,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import operator from collections import defaultdict from time import time diff --git a/examples/calibration/plot_calibration_curve.py b/examples/calibration/plot_calibration_curve.py index 03bc28e25740a..1c5e297026ae7 100644 --- a/examples/calibration/plot_calibration_curve.py +++ b/examples/calibration/plot_calibration_curve.py @@ -14,6 +14,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + # %% # Dataset # ------- diff --git a/examples/calibration/plot_compare_calibration.py b/examples/calibration/plot_compare_calibration.py index 33898d8f151f3..aa60de1032765 100644 --- a/examples/calibration/plot_compare_calibration.py +++ b/examples/calibration/plot_compare_calibration.py @@ -19,6 +19,7 @@ # %% # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + # # Dataset # ------- diff --git a/examples/classification/plot_classifier_comparison.py b/examples/classification/plot_classifier_comparison.py index 4fb8a142e2606..5747d00ba7950 100644 --- a/examples/classification/plot_classifier_comparison.py +++ b/examples/classification/plot_classifier_comparison.py @@ -19,9 +19,7 @@ """ -# Code source: Gaël Varoquaux -# Andreas Müller -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/classification/plot_lda.py b/examples/classification/plot_lda.py index 88135079529c8..cf052a9379b22 100644 --- a/examples/classification/plot_lda.py +++ b/examples/classification/plot_lda.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/classification/plot_lda_qda.py b/examples/classification/plot_lda_qda.py index 0691f52390a06..599659fdac2dc 100644 --- a/examples/classification/plot_lda_qda.py +++ b/examples/classification/plot_lda_qda.py @@ -11,6 +11,9 @@ deviation with QDA. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Data generation # --------------- diff --git a/examples/cluster/plot_affinity_propagation.py b/examples/cluster/plot_affinity_propagation.py index e286104636d67..2066212abea5d 100644 --- a/examples/cluster/plot_affinity_propagation.py +++ b/examples/cluster/plot_affinity_propagation.py @@ -9,6 +9,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from sklearn import metrics diff --git a/examples/cluster/plot_agglomerative_dendrogram.py b/examples/cluster/plot_agglomerative_dendrogram.py index 2acb3675ff7c1..bea2a5e84653a 100644 --- a/examples/cluster/plot_agglomerative_dendrogram.py +++ b/examples/cluster/plot_agglomerative_dendrogram.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + """ ========================================= Plot Hierarchical Clustering Dendrogram diff --git a/examples/cluster/plot_bisect_kmeans.py b/examples/cluster/plot_bisect_kmeans.py index a562ebbc96ba5..7fc738bf08218 100644 --- a/examples/cluster/plot_bisect_kmeans.py +++ b/examples/cluster/plot_bisect_kmeans.py @@ -14,6 +14,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn.cluster import BisectingKMeans, KMeans diff --git a/examples/cluster/plot_cluster_comparison.py b/examples/cluster/plot_cluster_comparison.py index bc6f158c02ed0..539c07cfd442e 100644 --- a/examples/cluster/plot_cluster_comparison.py +++ b/examples/cluster/plot_cluster_comparison.py @@ -24,6 +24,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import time import warnings from itertools import cycle, islice diff --git a/examples/cluster/plot_cluster_iris.py b/examples/cluster/plot_cluster_iris.py index e3a6d6a3d8664..1a34a9b3534bc 100644 --- a/examples/cluster/plot_cluster_iris.py +++ b/examples/cluster/plot_cluster_iris.py @@ -18,8 +18,7 @@ """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/cluster/plot_dbscan.py b/examples/cluster/plot_dbscan.py index 0b0bd64ecf62b..af56701db846f 100644 --- a/examples/cluster/plot_dbscan.py +++ b/examples/cluster/plot_dbscan.py @@ -12,6 +12,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Data generation # --------------- diff --git a/examples/cluster/plot_dict_face_patches.py b/examples/cluster/plot_dict_face_patches.py index 99b241bfdeea9..27eeb07ec7867 100644 --- a/examples/cluster/plot_dict_face_patches.py +++ b/examples/cluster/plot_dict_face_patches.py @@ -21,6 +21,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load the data # ------------- diff --git a/examples/cluster/plot_digits_agglomeration.py b/examples/cluster/plot_digits_agglomeration.py index 3773a300cb51a..8de14b0729f53 100644 --- a/examples/cluster/plot_digits_agglomeration.py +++ b/examples/cluster/plot_digits_agglomeration.py @@ -8,8 +8,7 @@ """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/cluster/plot_hdbscan.py b/examples/cluster/plot_hdbscan.py index 630ab1f150fcb..64d4936694bf3 100644 --- a/examples/cluster/plot_hdbscan.py +++ b/examples/cluster/plot_hdbscan.py @@ -12,6 +12,10 @@ We first define a couple utility functions for convenience. """ + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% import matplotlib.pyplot as plt import numpy as np diff --git a/examples/cluster/plot_inductive_clustering.py b/examples/cluster/plot_inductive_clustering.py index b6464459160e3..29846b15cdb60 100644 --- a/examples/cluster/plot_inductive_clustering.py +++ b/examples/cluster/plot_inductive_clustering.py @@ -20,8 +20,8 @@ """ -# Authors: Chirag Nagpal -# Christos Aridas +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/cluster/plot_kmeans_digits.py b/examples/cluster/plot_kmeans_digits.py index d61ec91d13d52..3e7c70b9d08a9 100644 --- a/examples/cluster/plot_kmeans_digits.py +++ b/examples/cluster/plot_kmeans_digits.py @@ -25,6 +25,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load the dataset # ---------------- diff --git a/examples/cluster/plot_kmeans_plusplus.py b/examples/cluster/plot_kmeans_plusplus.py index 69ea738635ddf..355426a2a4872 100644 --- a/examples/cluster/plot_kmeans_plusplus.py +++ b/examples/cluster/plot_kmeans_plusplus.py @@ -10,6 +10,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn.cluster import kmeans_plusplus diff --git a/examples/cluster/plot_kmeans_silhouette_analysis.py b/examples/cluster/plot_kmeans_silhouette_analysis.py index a999e83fcac5d..4b5c8d2c6d66d 100644 --- a/examples/cluster/plot_kmeans_silhouette_analysis.py +++ b/examples/cluster/plot_kmeans_silhouette_analysis.py @@ -31,6 +31,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.cm as cm import matplotlib.pyplot as plt import numpy as np diff --git a/examples/cluster/plot_linkage_comparison.py b/examples/cluster/plot_linkage_comparison.py index 793fee059d797..c08dedfbab1bc 100644 --- a/examples/cluster/plot_linkage_comparison.py +++ b/examples/cluster/plot_linkage_comparison.py @@ -23,6 +23,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import time import warnings from itertools import cycle, islice diff --git a/examples/cluster/plot_mean_shift.py b/examples/cluster/plot_mean_shift.py index aacbc7f216405..456a1c4ac2020 100644 --- a/examples/cluster/plot_mean_shift.py +++ b/examples/cluster/plot_mean_shift.py @@ -11,6 +11,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from sklearn.cluster import MeanShift, estimate_bandwidth diff --git a/examples/cluster/plot_mini_batch_kmeans.py b/examples/cluster/plot_mini_batch_kmeans.py index 3a6e8aa63786b..d189ed0e02a5c 100644 --- a/examples/cluster/plot_mini_batch_kmeans.py +++ b/examples/cluster/plot_mini_batch_kmeans.py @@ -14,6 +14,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate the data # ----------------- diff --git a/examples/compose/plot_compare_reduction.py b/examples/compose/plot_compare_reduction.py index 529366c6244f2..cfe22d646244c 100644 --- a/examples/compose/plot_compare_reduction.py +++ b/examples/compose/plot_compare_reduction.py @@ -20,9 +20,8 @@ """ -# Authors: Robert McGibbon -# Joel Nothman -# Guillaume Lemaitre +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause # %% # Illustration of ``Pipeline`` and ``GridSearchCV`` diff --git a/examples/compose/plot_digits_pipe.py b/examples/compose/plot_digits_pipe.py index 511878fcd4d99..8a202bb5bd74c 100644 --- a/examples/compose/plot_digits_pipe.py +++ b/examples/compose/plot_digits_pipe.py @@ -10,8 +10,7 @@ """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/covariance/plot_covariance_estimation.py b/examples/covariance/plot_covariance_estimation.py index 04baa0fd98bc0..1fdede5364eec 100644 --- a/examples/covariance/plot_covariance_estimation.py +++ b/examples/covariance/plot_covariance_estimation.py @@ -15,6 +15,9 @@ trade-off. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate sample data # -------------------- diff --git a/examples/covariance/plot_lw_vs_oas.py b/examples/covariance/plot_lw_vs_oas.py index 107f6bd1c29cc..c1c41bc811a85 100644 --- a/examples/covariance/plot_lw_vs_oas.py +++ b/examples/covariance/plot_lw_vs_oas.py @@ -21,6 +21,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np from scipy.linalg import cholesky, toeplitz diff --git a/examples/covariance/plot_mahalanobis_distances.py b/examples/covariance/plot_mahalanobis_distances.py index 537d3fa0d9d8a..a1507c3ef162e 100644 --- a/examples/covariance/plot_mahalanobis_distances.py +++ b/examples/covariance/plot_mahalanobis_distances.py @@ -62,6 +62,9 @@ """ # noqa: E501 +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate data # -------------- diff --git a/examples/covariance/plot_robust_vs_empirical_covariance.py b/examples/covariance/plot_robust_vs_empirical_covariance.py index c61a97ddd979b..54871c495e82c 100644 --- a/examples/covariance/plot_robust_vs_empirical_covariance.py +++ b/examples/covariance/plot_robust_vs_empirical_covariance.py @@ -53,6 +53,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.font_manager import matplotlib.pyplot as plt import numpy as np diff --git a/examples/cross_decomposition/plot_compare_cross_decomposition.py b/examples/cross_decomposition/plot_compare_cross_decomposition.py index 762c42dfdf31c..1fce2f70bc42a 100644 --- a/examples/cross_decomposition/plot_compare_cross_decomposition.py +++ b/examples/cross_decomposition/plot_compare_cross_decomposition.py @@ -21,6 +21,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Dataset based latent variables model # ------------------------------------ diff --git a/examples/cross_decomposition/plot_pcr_vs_pls.py b/examples/cross_decomposition/plot_pcr_vs_pls.py index 895c75dc1a728..e0606a5c3dd42 100644 --- a/examples/cross_decomposition/plot_pcr_vs_pls.py +++ b/examples/cross_decomposition/plot_pcr_vs_pls.py @@ -33,6 +33,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # The data # -------- diff --git a/examples/datasets/plot_digits_last_image.py b/examples/datasets/plot_digits_last_image.py index ce6c48e58715e..eada3b12588da 100644 --- a/examples/datasets/plot_digits_last_image.py +++ b/examples/datasets/plot_digits_last_image.py @@ -14,8 +14,7 @@ """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/datasets/plot_iris_dataset.py b/examples/datasets/plot_iris_dataset.py index d36ebca1ebe83..d9560e51ef245 100644 --- a/examples/datasets/plot_iris_dataset.py +++ b/examples/datasets/plot_iris_dataset.py @@ -15,8 +15,7 @@ """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # %% diff --git a/examples/datasets/plot_random_dataset.py b/examples/datasets/plot_random_dataset.py index e5cbdb080b59f..50ae2def9eaae 100644 --- a/examples/datasets/plot_random_dataset.py +++ b/examples/datasets/plot_random_dataset.py @@ -14,6 +14,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn.datasets import make_blobs, make_classification, make_gaussian_quantiles diff --git a/examples/datasets/plot_random_multilabel_dataset.py b/examples/datasets/plot_random_multilabel_dataset.py index e6e2d6ad9edcf..36a8bc23e4d11 100644 --- a/examples/datasets/plot_random_multilabel_dataset.py +++ b/examples/datasets/plot_random_multilabel_dataset.py @@ -35,6 +35,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/decomposition/plot_faces_decomposition.py b/examples/decomposition/plot_faces_decomposition.py index 2ed22a52f7d34..7082c922e1086 100644 --- a/examples/decomposition/plot_faces_decomposition.py +++ b/examples/decomposition/plot_faces_decomposition.py @@ -13,6 +13,9 @@ - License: BSD 3 clause """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Dataset preparation # ------------------- diff --git a/examples/decomposition/plot_ica_blind_source_separation.py b/examples/decomposition/plot_ica_blind_source_separation.py index 584d6b9509589..e8d571d814a1b 100644 --- a/examples/decomposition/plot_ica_blind_source_separation.py +++ b/examples/decomposition/plot_ica_blind_source_separation.py @@ -14,6 +14,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate sample data # -------------------- diff --git a/examples/decomposition/plot_image_denoising.py b/examples/decomposition/plot_image_denoising.py index 646669d1469ff..5248fdff5a8ca 100644 --- a/examples/decomposition/plot_image_denoising.py +++ b/examples/decomposition/plot_image_denoising.py @@ -32,6 +32,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate distorted image # ------------------------ diff --git a/examples/decomposition/plot_pca_iris.py b/examples/decomposition/plot_pca_iris.py index f574e14bdfd17..1ceecc0058b67 100644 --- a/examples/decomposition/plot_pca_iris.py +++ b/examples/decomposition/plot_pca_iris.py @@ -10,7 +10,7 @@ """ -# Code source: Gaël Varoquaux +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/decomposition/plot_pca_vs_lda.py b/examples/decomposition/plot_pca_vs_lda.py index e88a0aff7882f..4679a410af76a 100644 --- a/examples/decomposition/plot_pca_vs_lda.py +++ b/examples/decomposition/plot_pca_vs_lda.py @@ -18,6 +18,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn import datasets diff --git a/examples/decomposition/plot_sparse_coding.py b/examples/decomposition/plot_sparse_coding.py index c45cd3c83b04f..778f718c2ac87 100644 --- a/examples/decomposition/plot_sparse_coding.py +++ b/examples/decomposition/plot_sparse_coding.py @@ -16,6 +16,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/ensemble/plot_adaboost_multiclass.py b/examples/ensemble/plot_adaboost_multiclass.py index 8ae7372b0874f..a18ff4e09c7bb 100644 --- a/examples/ensemble/plot_adaboost_multiclass.py +++ b/examples/ensemble/plot_adaboost_multiclass.py @@ -25,7 +25,7 @@ """ -# Noel Dawe +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # %% diff --git a/examples/ensemble/plot_forest_importances.py b/examples/ensemble/plot_forest_importances.py index 269451168dd7a..b77e30c327fb4 100644 --- a/examples/ensemble/plot_forest_importances.py +++ b/examples/ensemble/plot_forest_importances.py @@ -13,6 +13,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt # %% diff --git a/examples/ensemble/plot_forest_importances_faces.py b/examples/ensemble/plot_forest_importances_faces.py index 8b8e8751ec5a2..5b8db11b1692e 100644 --- a/examples/ensemble/plot_forest_importances_faces.py +++ b/examples/ensemble/plot_forest_importances_faces.py @@ -12,6 +12,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Loading the data and model fitting # ---------------------------------- diff --git a/examples/ensemble/plot_forest_iris.py b/examples/ensemble/plot_forest_iris.py index c2056ce1905d1..78a28e521ff90 100644 --- a/examples/ensemble/plot_forest_iris.py +++ b/examples/ensemble/plot_forest_iris.py @@ -42,6 +42,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import ListedColormap diff --git a/examples/ensemble/plot_gradient_boosting_categorical.py b/examples/ensemble/plot_gradient_boosting_categorical.py index 2e260a4be1802..e80c0fb6fdc6e 100644 --- a/examples/ensemble/plot_gradient_boosting_categorical.py +++ b/examples/ensemble/plot_gradient_boosting_categorical.py @@ -27,6 +27,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load Ames Housing dataset # ------------------------- diff --git a/examples/ensemble/plot_gradient_boosting_early_stopping.py b/examples/ensemble/plot_gradient_boosting_early_stopping.py index 6c239e97d66ee..39e8b19a3125f 100644 --- a/examples/ensemble/plot_gradient_boosting_early_stopping.py +++ b/examples/ensemble/plot_gradient_boosting_early_stopping.py @@ -32,6 +32,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Data Preparation # ---------------- diff --git a/examples/ensemble/plot_gradient_boosting_quantile.py b/examples/ensemble/plot_gradient_boosting_quantile.py index 723a494b04db8..3e2c44568de3c 100644 --- a/examples/ensemble/plot_gradient_boosting_quantile.py +++ b/examples/ensemble/plot_gradient_boosting_quantile.py @@ -10,6 +10,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate some data for a synthetic regression problem by applying the # function f to uniformly sampled random inputs. diff --git a/examples/ensemble/plot_isolation_forest.py b/examples/ensemble/plot_isolation_forest.py index f5fad1d7b9ea9..2bd5bc9e99a0e 100644 --- a/examples/ensemble/plot_isolation_forest.py +++ b/examples/ensemble/plot_isolation_forest.py @@ -16,6 +16,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Data generation # --------------- diff --git a/examples/ensemble/plot_monotonic_constraints.py b/examples/ensemble/plot_monotonic_constraints.py index dcd5f05af626c..40fb61eae19e9 100644 --- a/examples/ensemble/plot_monotonic_constraints.py +++ b/examples/ensemble/plot_monotonic_constraints.py @@ -20,6 +20,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% import matplotlib.pyplot as plt import numpy as np diff --git a/examples/ensemble/plot_random_forest_embedding.py b/examples/ensemble/plot_random_forest_embedding.py index fe26e04ca7789..d3d595df232a9 100644 --- a/examples/ensemble/plot_random_forest_embedding.py +++ b/examples/ensemble/plot_random_forest_embedding.py @@ -26,6 +26,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/ensemble/plot_voting_decision_regions.py b/examples/ensemble/plot_voting_decision_regions.py index 90441c6d28339..d40d831fb911f 100644 --- a/examples/ensemble/plot_voting_decision_regions.py +++ b/examples/ensemble/plot_voting_decision_regions.py @@ -23,6 +23,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from itertools import product import matplotlib.pyplot as plt diff --git a/examples/ensemble/plot_voting_probas.py b/examples/ensemble/plot_voting_probas.py index 424959e6d5072..848358ca1d208 100644 --- a/examples/ensemble/plot_voting_probas.py +++ b/examples/ensemble/plot_voting_probas.py @@ -23,6 +23,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/ensemble/plot_voting_regressor.py b/examples/ensemble/plot_voting_regressor.py index d33becca505e3..6ccc4e81b700a 100644 --- a/examples/ensemble/plot_voting_regressor.py +++ b/examples/ensemble/plot_voting_regressor.py @@ -23,6 +23,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn.datasets import load_diabetes diff --git a/examples/exercises/plot_cv_diabetes.py b/examples/exercises/plot_cv_diabetes.py index 9d0232de9e660..5e582b4b21571 100644 --- a/examples/exercises/plot_cv_diabetes.py +++ b/examples/exercises/plot_cv_diabetes.py @@ -10,6 +10,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load dataset and apply GridSearchCV # ----------------------------------- diff --git a/examples/exercises/plot_digits_classification_exercise.py b/examples/exercises/plot_digits_classification_exercise.py index 25b0171c66421..d65006178ca4f 100644 --- a/examples/exercises/plot_digits_classification_exercise.py +++ b/examples/exercises/plot_digits_classification_exercise.py @@ -12,6 +12,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from sklearn import datasets, linear_model, neighbors X_digits, y_digits = datasets.load_digits(return_X_y=True) diff --git a/examples/exercises/plot_iris_exercise.py b/examples/exercises/plot_iris_exercise.py index 07687b920e1b8..8dcc4368ab620 100644 --- a/examples/exercises/plot_iris_exercise.py +++ b/examples/exercises/plot_iris_exercise.py @@ -10,6 +10,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/feature_selection/plot_f_test_vs_mi.py b/examples/feature_selection/plot_f_test_vs_mi.py index 5c015e7e4fd58..e3c75d39e0a27 100644 --- a/examples/feature_selection/plot_f_test_vs_mi.py +++ b/examples/feature_selection/plot_f_test_vs_mi.py @@ -23,6 +23,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/feature_selection/plot_feature_selection.py b/examples/feature_selection/plot_feature_selection.py index 2cf64cb6ea598..520747f417db1 100644 --- a/examples/feature_selection/plot_feature_selection.py +++ b/examples/feature_selection/plot_feature_selection.py @@ -16,6 +16,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate sample data # -------------------- diff --git a/examples/feature_selection/plot_feature_selection_pipeline.py b/examples/feature_selection/plot_feature_selection_pipeline.py index 1d7c44050ea78..b33bfeda0a37a 100644 --- a/examples/feature_selection/plot_feature_selection_pipeline.py +++ b/examples/feature_selection/plot_feature_selection_pipeline.py @@ -10,6 +10,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # We will start by generating a binary classification dataset. Subsequently, we # will divide the dataset into two subsets. diff --git a/examples/feature_selection/plot_rfe_digits.py b/examples/feature_selection/plot_rfe_digits.py index 198a3d6f3af90..360a9bd92837f 100644 --- a/examples/feature_selection/plot_rfe_digits.py +++ b/examples/feature_selection/plot_rfe_digits.py @@ -18,6 +18,9 @@ """ # noqa: E501 +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn.datasets import load_digits diff --git a/examples/feature_selection/plot_rfe_with_cross_validation.py b/examples/feature_selection/plot_rfe_with_cross_validation.py index 6e4a8ae0ee8c5..4e3e45384e026 100644 --- a/examples/feature_selection/plot_rfe_with_cross_validation.py +++ b/examples/feature_selection/plot_rfe_with_cross_validation.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Data generation # --------------- diff --git a/examples/feature_selection/plot_select_from_model_diabetes.py b/examples/feature_selection/plot_select_from_model_diabetes.py index f008d8d6e8b68..9359e9a982742 100644 --- a/examples/feature_selection/plot_select_from_model_diabetes.py +++ b/examples/feature_selection/plot_select_from_model_diabetes.py @@ -19,6 +19,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Loading the data # ---------------- diff --git a/examples/gaussian_process/plot_gpc_iris.py b/examples/gaussian_process/plot_gpc_iris.py index 88c536d8824c8..a01d9ac081d7e 100644 --- a/examples/gaussian_process/plot_gpc_iris.py +++ b/examples/gaussian_process/plot_gpc_iris.py @@ -10,6 +10,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/gaussian_process/plot_gpr_on_structured_data.py b/examples/gaussian_process/plot_gpr_on_structured_data.py index e702f1fe0769a..f3a8de5d018ef 100644 --- a/examples/gaussian_process/plot_gpr_on_structured_data.py +++ b/examples/gaussian_process/plot_gpr_on_structured_data.py @@ -38,6 +38,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% import numpy as np diff --git a/examples/impute/plot_iterative_imputer_variants_comparison.py b/examples/impute/plot_iterative_imputer_variants_comparison.py index 445a08c05f02f..f06875a5f7fcd 100644 --- a/examples/impute/plot_iterative_imputer_variants_comparison.py +++ b/examples/impute/plot_iterative_imputer_variants_comparison.py @@ -44,6 +44,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np import pandas as pd diff --git a/examples/inspection/plot_causal_interpretation.py b/examples/inspection/plot_causal_interpretation.py index 68f10b5304842..cf6c72f29951d 100644 --- a/examples/inspection/plot_causal_interpretation.py +++ b/examples/inspection/plot_causal_interpretation.py @@ -15,6 +15,9 @@ identifying that causal effect. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # The dataset: simulated hourly wages # ----------------------------------- diff --git a/examples/inspection/plot_linear_model_coefficient_interpretation.py b/examples/inspection/plot_linear_model_coefficient_interpretation.py index 0e11f01937ebc..f0ec361f4fa81 100644 --- a/examples/inspection/plot_linear_model_coefficient_interpretation.py +++ b/examples/inspection/plot_linear_model_coefficient_interpretation.py @@ -39,6 +39,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% import matplotlib.pyplot as plt import numpy as np diff --git a/examples/inspection/plot_partial_dependence.py b/examples/inspection/plot_partial_dependence.py index 4c3e0f409eeff..eace8afeb96a0 100644 --- a/examples/inspection/plot_partial_dependence.py +++ b/examples/inspection/plot_partial_dependence.py @@ -34,6 +34,9 @@ Graphical Statistics, 24(1): 44-65 <1309.6392>` """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Bike sharing dataset preprocessing # ---------------------------------- diff --git a/examples/inspection/plot_permutation_importance.py b/examples/inspection/plot_permutation_importance.py index 66b40fcd25bc8..73c5179a09b87 100644 --- a/examples/inspection/plot_permutation_importance.py +++ b/examples/inspection/plot_permutation_importance.py @@ -25,6 +25,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Data Loading and Feature Engineering # ------------------------------------ diff --git a/examples/inspection/plot_permutation_importance_multicollinear.py b/examples/inspection/plot_permutation_importance_multicollinear.py index d9faca695e24d..2924021281035 100644 --- a/examples/inspection/plot_permutation_importance_multicollinear.py +++ b/examples/inspection/plot_permutation_importance_multicollinear.py @@ -21,6 +21,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Random Forest Feature Importance on Breast Cancer Data # ------------------------------------------------------ diff --git a/examples/linear_model/plot_ard.py b/examples/linear_model/plot_ard.py index e39baa111c4e2..46cc619718afb 100644 --- a/examples/linear_model/plot_ard.py +++ b/examples/linear_model/plot_ard.py @@ -19,7 +19,8 @@ """ -# Author: Arturo Amor +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause # %% # Models robustness to recover the ground truth weights diff --git a/examples/linear_model/plot_bayesian_ridge_curvefit.py b/examples/linear_model/plot_bayesian_ridge_curvefit.py index 12f48b9ce347d..45679580dbf34 100644 --- a/examples/linear_model/plot_bayesian_ridge_curvefit.py +++ b/examples/linear_model/plot_bayesian_ridge_curvefit.py @@ -26,7 +26,8 @@ """ -# Author: Yoshihiro Uchida +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause # %% # Generate sinusoidal data with noise diff --git a/examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py b/examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py index b31d95348c083..e118847a8737c 100644 --- a/examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py +++ b/examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py @@ -17,6 +17,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Let's start by loading the dataset and creating some sample weights. import numpy as np diff --git a/examples/linear_model/plot_iris_logistic.py b/examples/linear_model/plot_iris_logistic.py index ca7cb00d5f878..481312c94c789 100644 --- a/examples/linear_model/plot_iris_logistic.py +++ b/examples/linear_model/plot_iris_logistic.py @@ -10,8 +10,7 @@ """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/linear_model/plot_lasso_and_elasticnet.py b/examples/linear_model/plot_lasso_and_elasticnet.py index 78ab9624b64a4..2db597fac96ac 100644 --- a/examples/linear_model/plot_lasso_and_elasticnet.py +++ b/examples/linear_model/plot_lasso_and_elasticnet.py @@ -21,7 +21,8 @@ compared with the ground-truth. """ -# Author: Arturo Amor +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause # %% # Generate synthetic dataset diff --git a/examples/linear_model/plot_lasso_dense_vs_sparse_data.py b/examples/linear_model/plot_lasso_dense_vs_sparse_data.py index a797d5d708160..920994da1ffb5 100644 --- a/examples/linear_model/plot_lasso_dense_vs_sparse_data.py +++ b/examples/linear_model/plot_lasso_dense_vs_sparse_data.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from time import time from scipy import linalg, sparse diff --git a/examples/linear_model/plot_logistic.py b/examples/linear_model/plot_logistic.py index a22bc5cb39119..b54c1fbf1340d 100644 --- a/examples/linear_model/plot_logistic.py +++ b/examples/linear_model/plot_logistic.py @@ -9,7 +9,7 @@ """ -# Code source: Gael Varoquaux +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/linear_model/plot_nnls.py b/examples/linear_model/plot_nnls.py index 05a8550ec166b..9ab19e19a1882 100644 --- a/examples/linear_model/plot_nnls.py +++ b/examples/linear_model/plot_nnls.py @@ -9,6 +9,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/linear_model/plot_ols.py b/examples/linear_model/plot_ols.py index d94bfadf435a9..8aaa35ed8d899 100644 --- a/examples/linear_model/plot_ols.py +++ b/examples/linear_model/plot_ols.py @@ -14,7 +14,7 @@ """ -# Code source: Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/linear_model/plot_ols_3d.py b/examples/linear_model/plot_ols_3d.py index 328131a3b81c0..cd848f659e8d8 100644 --- a/examples/linear_model/plot_ols_3d.py +++ b/examples/linear_model/plot_ols_3d.py @@ -9,8 +9,7 @@ give us much regarding `y` when compared to just feature 1. """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # %% diff --git a/examples/linear_model/plot_ols_ridge_variance.py b/examples/linear_model/plot_ols_ridge_variance.py index 324770887afcf..a65cc6eb7b7d1 100644 --- a/examples/linear_model/plot_ols_ridge_variance.py +++ b/examples/linear_model/plot_ols_ridge_variance.py @@ -19,11 +19,9 @@ """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause - import matplotlib.pyplot as plt import numpy as np diff --git a/examples/linear_model/plot_omp.py b/examples/linear_model/plot_omp.py index aa6044173b8ce..815b3c9425fdf 100644 --- a/examples/linear_model/plot_omp.py +++ b/examples/linear_model/plot_omp.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/linear_model/plot_poisson_regression_non_normal_loss.py b/examples/linear_model/plot_poisson_regression_non_normal_loss.py index 180ee3b70671c..741a92767e953 100644 --- a/examples/linear_model/plot_poisson_regression_non_normal_loss.py +++ b/examples/linear_model/plot_poisson_regression_non_normal_loss.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + """ ====================================== Poisson regression and non-normal loss diff --git a/examples/linear_model/plot_ransac.py b/examples/linear_model/plot_ransac.py index 7b89150c4bd20..ecef43e79f9bf 100644 --- a/examples/linear_model/plot_ransac.py +++ b/examples/linear_model/plot_ransac.py @@ -15,6 +15,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from matplotlib import pyplot as plt diff --git a/examples/linear_model/plot_ridge_coeffs.py b/examples/linear_model/plot_ridge_coeffs.py index 4bfb1f4c29325..1ad7962f8bfa3 100644 --- a/examples/linear_model/plot_ridge_coeffs.py +++ b/examples/linear_model/plot_ridge_coeffs.py @@ -51,7 +51,8 @@ capable of generalizing well to unseen data while avoiding overfitting. """ -# Author: Kornel Kielczewski -- +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause # %% # Purpose of this example diff --git a/examples/linear_model/plot_robust_fit.py b/examples/linear_model/plot_robust_fit.py index 79213c9a8e83e..2b447e6175cdc 100644 --- a/examples/linear_model/plot_robust_fit.py +++ b/examples/linear_model/plot_robust_fit.py @@ -30,6 +30,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from matplotlib import pyplot as plt diff --git a/examples/linear_model/plot_sgd_iris.py b/examples/linear_model/plot_sgd_iris.py index 838f612d4659c..46dc2e7c31cd1 100644 --- a/examples/linear_model/plot_sgd_iris.py +++ b/examples/linear_model/plot_sgd_iris.py @@ -9,6 +9,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/linear_model/plot_sgd_loss_functions.py b/examples/linear_model/plot_sgd_loss_functions.py index 140562184b946..b0c61da6ddcc1 100644 --- a/examples/linear_model/plot_sgd_loss_functions.py +++ b/examples/linear_model/plot_sgd_loss_functions.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/linear_model/plot_sgd_penalties.py b/examples/linear_model/plot_sgd_penalties.py index ff71dba5f20a3..6f8830b52fe7a 100644 --- a/examples/linear_model/plot_sgd_penalties.py +++ b/examples/linear_model/plot_sgd_penalties.py @@ -11,6 +11,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/linear_model/plot_sgd_separating_hyperplane.py b/examples/linear_model/plot_sgd_separating_hyperplane.py index e84ab7c519ae9..90f7502900291 100644 --- a/examples/linear_model/plot_sgd_separating_hyperplane.py +++ b/examples/linear_model/plot_sgd_separating_hyperplane.py @@ -9,6 +9,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/linear_model/plot_sgd_weighted_samples.py b/examples/linear_model/plot_sgd_weighted_samples.py index 4d605e99b4e49..e9e6587004e70 100644 --- a/examples/linear_model/plot_sgd_weighted_samples.py +++ b/examples/linear_model/plot_sgd_weighted_samples.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/linear_model/plot_sgdocsvm_vs_ocsvm.py b/examples/linear_model/plot_sgdocsvm_vs_ocsvm.py index 60e9cd8078802..aabc8058dc407 100644 --- a/examples/linear_model/plot_sgdocsvm_vs_ocsvm.py +++ b/examples/linear_model/plot_sgdocsvm_vs_ocsvm.py @@ -19,6 +19,9 @@ """ # noqa: E501 +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% import matplotlib import matplotlib.lines as mlines diff --git a/examples/linear_model/plot_sparse_logistic_regression_20newsgroups.py b/examples/linear_model/plot_sparse_logistic_regression_20newsgroups.py index 404250a855e0a..fdf914f3a7ab2 100644 --- a/examples/linear_model/plot_sparse_logistic_regression_20newsgroups.py +++ b/examples/linear_model/plot_sparse_logistic_regression_20newsgroups.py @@ -20,7 +20,8 @@ """ -# Author: Arthur Mensch +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import timeit import warnings diff --git a/examples/linear_model/plot_tweedie_regression_insurance_claims.py b/examples/linear_model/plot_tweedie_regression_insurance_claims.py index 31a91fb37c766..1e987bfaa6dc2 100644 --- a/examples/linear_model/plot_tweedie_regression_insurance_claims.py +++ b/examples/linear_model/plot_tweedie_regression_insurance_claims.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + """ ====================================== Tweedie regression on insurance claims diff --git a/examples/manifold/plot_compare_methods.py b/examples/manifold/plot_compare_methods.py index a3d3947d5b85f..30ce4e5d8d897 100644 --- a/examples/manifold/plot_compare_methods.py +++ b/examples/manifold/plot_compare_methods.py @@ -20,7 +20,8 @@ """ -# Author: Jake Vanderplas -- +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause # %% # Dataset preparation diff --git a/examples/manifold/plot_swissroll.py b/examples/manifold/plot_swissroll.py index 65df88588efef..803dc391ba4c2 100644 --- a/examples/manifold/plot_swissroll.py +++ b/examples/manifold/plot_swissroll.py @@ -9,6 +9,9 @@ in the data. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Swiss Roll # --------------------------------------------------- diff --git a/examples/miscellaneous/plot_display_object_visualization.py b/examples/miscellaneous/plot_display_object_visualization.py index 075413379a92c..cf39a1407d28e 100644 --- a/examples/miscellaneous/plot_display_object_visualization.py +++ b/examples/miscellaneous/plot_display_object_visualization.py @@ -15,6 +15,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load Data and train model # ------------------------- diff --git a/examples/miscellaneous/plot_estimator_representation.py b/examples/miscellaneous/plot_estimator_representation.py index 1c9e3745db0de..683f0c5785f20 100644 --- a/examples/miscellaneous/plot_estimator_representation.py +++ b/examples/miscellaneous/plot_estimator_representation.py @@ -7,6 +7,9 @@ displayed. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from sklearn.compose import make_column_transformer from sklearn.impute import SimpleImputer from sklearn.linear_model import LogisticRegression diff --git a/examples/miscellaneous/plot_johnson_lindenstrauss_bound.py b/examples/miscellaneous/plot_johnson_lindenstrauss_bound.py index 85161a6ee51bb..5528eada1ed4a 100644 --- a/examples/miscellaneous/plot_johnson_lindenstrauss_bound.py +++ b/examples/miscellaneous/plot_johnson_lindenstrauss_bound.py @@ -13,6 +13,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import sys from time import time diff --git a/examples/miscellaneous/plot_metadata_routing.py b/examples/miscellaneous/plot_metadata_routing.py index e96b54436cf30..634ca304d125d 100644 --- a/examples/miscellaneous/plot_metadata_routing.py +++ b/examples/miscellaneous/plot_metadata_routing.py @@ -27,6 +27,9 @@ First a few imports and some random data for the rest of the script. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% import warnings diff --git a/examples/miscellaneous/plot_multioutput_face_completion.py b/examples/miscellaneous/plot_multioutput_face_completion.py index 62070bc05e488..a924da0d2b4a5 100644 --- a/examples/miscellaneous/plot_multioutput_face_completion.py +++ b/examples/miscellaneous/plot_multioutput_face_completion.py @@ -12,6 +12,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/miscellaneous/plot_partial_dependence_visualization_api.py b/examples/miscellaneous/plot_partial_dependence_visualization_api.py index 38a984fa5b0cd..8c98b40816496 100644 --- a/examples/miscellaneous/plot_partial_dependence_visualization_api.py +++ b/examples/miscellaneous/plot_partial_dependence_visualization_api.py @@ -13,6 +13,9 @@ """ # noqa: E501 +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import pandas as pd diff --git a/examples/miscellaneous/plot_pipeline_display.py b/examples/miscellaneous/plot_pipeline_display.py index 9642bb56b903f..bf9ff2e549f8b 100755 --- a/examples/miscellaneous/plot_pipeline_display.py +++ b/examples/miscellaneous/plot_pipeline_display.py @@ -11,6 +11,9 @@ steps in the pipeline. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Displaying a Pipeline with a Preprocessing Step and Classifier ################################################################################ diff --git a/examples/miscellaneous/plot_roc_curve_visualization_api.py b/examples/miscellaneous/plot_roc_curve_visualization_api.py index 7fc8df9724337..d377d321e061e 100644 --- a/examples/miscellaneous/plot_roc_curve_visualization_api.py +++ b/examples/miscellaneous/plot_roc_curve_visualization_api.py @@ -9,6 +9,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load Data and Train a SVC # ------------------------- diff --git a/examples/mixture/plot_gmm.py b/examples/mixture/plot_gmm.py index 82e48a8d13eb0..9a27b1c42f81a 100644 --- a/examples/mixture/plot_gmm.py +++ b/examples/mixture/plot_gmm.py @@ -24,6 +24,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import itertools import matplotlib as mpl diff --git a/examples/mixture/plot_gmm_init.py b/examples/mixture/plot_gmm_init.py index 410a843cf78db..0178d4a07af11 100644 --- a/examples/mixture/plot_gmm_init.py +++ b/examples/mixture/plot_gmm_init.py @@ -33,8 +33,8 @@ time to initialize and low number of GaussianMixture iterations to converge. """ -# Author: Gordon Walsh -# Data generation code from Jake Vanderplas +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause from timeit import default_timer as timer diff --git a/examples/mixture/plot_gmm_pdf.py b/examples/mixture/plot_gmm_pdf.py index 062bdfd4d6d67..be70578402f55 100644 --- a/examples/mixture/plot_gmm_pdf.py +++ b/examples/mixture/plot_gmm_pdf.py @@ -9,6 +9,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import LogNorm diff --git a/examples/mixture/plot_gmm_selection.py b/examples/mixture/plot_gmm_selection.py index cd84c03ab7d13..ef256aa4f8e0f 100644 --- a/examples/mixture/plot_gmm_selection.py +++ b/examples/mixture/plot_gmm_selection.py @@ -14,6 +14,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Data generation # --------------- diff --git a/examples/mixture/plot_gmm_sin.py b/examples/mixture/plot_gmm_sin.py index 34af17b8920bc..fe9c12bbe5adc 100644 --- a/examples/mixture/plot_gmm_sin.py +++ b/examples/mixture/plot_gmm_sin.py @@ -39,6 +39,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import itertools import matplotlib as mpl diff --git a/examples/model_selection/plot_confusion_matrix.py b/examples/model_selection/plot_confusion_matrix.py index 278083a994e58..9a0312d34f005 100644 --- a/examples/model_selection/plot_confusion_matrix.py +++ b/examples/model_selection/plot_confusion_matrix.py @@ -24,6 +24,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/model_selection/plot_cost_sensitive_learning.py b/examples/model_selection/plot_cost_sensitive_learning.py index 55707e78e137a..3021d5aaab53d 100644 --- a/examples/model_selection/plot_cost_sensitive_learning.py +++ b/examples/model_selection/plot_cost_sensitive_learning.py @@ -35,6 +35,9 @@ `_ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Cost-sensitive learning with constant gains and costs # ----------------------------------------------------- diff --git a/examples/model_selection/plot_cv_indices.py b/examples/model_selection/plot_cv_indices.py index d456546891069..b922fc75d7473 100644 --- a/examples/model_selection/plot_cv_indices.py +++ b/examples/model_selection/plot_cv_indices.py @@ -12,6 +12,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np from matplotlib.patches import Patch diff --git a/examples/model_selection/plot_cv_predict.py b/examples/model_selection/plot_cv_predict.py index bae1cffbd24e7..fa77749020d2b 100644 --- a/examples/model_selection/plot_cv_predict.py +++ b/examples/model_selection/plot_cv_predict.py @@ -9,6 +9,9 @@ errors. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # We will load the diabetes dataset and create an instance of a linear # regression model. diff --git a/examples/model_selection/plot_det.py b/examples/model_selection/plot_det.py index 3e56b8bd35d31..bf72fc8ade61f 100644 --- a/examples/model_selection/plot_det.py +++ b/examples/model_selection/plot_det.py @@ -33,6 +33,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate synthetic data # ----------------------- diff --git a/examples/model_selection/plot_grid_search_digits.py b/examples/model_selection/plot_grid_search_digits.py index ec4360692aaf3..f9d7adc2a404b 100644 --- a/examples/model_selection/plot_grid_search_digits.py +++ b/examples/model_selection/plot_grid_search_digits.py @@ -15,6 +15,9 @@ sections on :ref:`cross_validation` and :ref:`grid_search`. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # The dataset # ----------- diff --git a/examples/model_selection/plot_grid_search_refit_callable.py b/examples/model_selection/plot_grid_search_refit_callable.py index a851ee5f9bb19..2b13ee5ad584c 100644 --- a/examples/model_selection/plot_grid_search_refit_callable.py +++ b/examples/model_selection/plot_grid_search_refit_callable.py @@ -18,7 +18,8 @@ """ -# Author: Wenhao Zhang +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt import numpy as np diff --git a/examples/model_selection/plot_grid_search_stats.py b/examples/model_selection/plot_grid_search_stats.py index 9335b12055515..a4f1c8e1417ba 100644 --- a/examples/model_selection/plot_grid_search_stats.py +++ b/examples/model_selection/plot_grid_search_stats.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # We will start by simulating moon shaped data (where the ideal separation # between classes is non-linear), adding to it a moderate degree of noise. diff --git a/examples/model_selection/plot_learning_curve.py b/examples/model_selection/plot_learning_curve.py index 450392679095f..d8060c67cbe15 100644 --- a/examples/model_selection/plot_learning_curve.py +++ b/examples/model_selection/plot_learning_curve.py @@ -13,6 +13,9 @@ accuracy. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Learning Curve # ============== diff --git a/examples/model_selection/plot_likelihood_ratios.py b/examples/model_selection/plot_likelihood_ratios.py index 9a3f29def9e98..b5a68eb79810f 100644 --- a/examples/model_selection/plot_likelihood_ratios.py +++ b/examples/model_selection/plot_likelihood_ratios.py @@ -25,8 +25,9 @@ class proportion than the target application. """ -# Authors: Arturo Amor -# Olivier Grisel +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Pre-test vs. post-test analysis # =============================== diff --git a/examples/model_selection/plot_nested_cross_validation_iris.py b/examples/model_selection/plot_nested_cross_validation_iris.py index 38defdadf4165..15082123761af 100644 --- a/examples/model_selection/plot_nested_cross_validation_iris.py +++ b/examples/model_selection/plot_nested_cross_validation_iris.py @@ -44,6 +44,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from matplotlib import pyplot as plt diff --git a/examples/model_selection/plot_precision_recall.py b/examples/model_selection/plot_precision_recall.py index 6934f0f49ddde..f40c7262fb03f 100644 --- a/examples/model_selection/plot_precision_recall.py +++ b/examples/model_selection/plot_precision_recall.py @@ -92,6 +92,9 @@ :func:`sklearn.metrics.f1_score` """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # In binary classification settings # --------------------------------- diff --git a/examples/model_selection/plot_randomized_search.py b/examples/model_selection/plot_randomized_search.py index 140b359ff1934..7acd3a5550acf 100644 --- a/examples/model_selection/plot_randomized_search.py +++ b/examples/model_selection/plot_randomized_search.py @@ -20,6 +20,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from time import time import numpy as np diff --git a/examples/model_selection/plot_roc.py b/examples/model_selection/plot_roc.py index 5a94afcdf1edf..1b2a9760342a3 100644 --- a/examples/model_selection/plot_roc.py +++ b/examples/model_selection/plot_roc.py @@ -33,6 +33,9 @@ curves and their respective AUC. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load and prepare data # ===================== diff --git a/examples/model_selection/plot_roc_crossval.py b/examples/model_selection/plot_roc_crossval.py index 962b39754f8bd..fb6432a71ed79 100644 --- a/examples/model_selection/plot_roc_crossval.py +++ b/examples/model_selection/plot_roc_crossval.py @@ -27,6 +27,9 @@ generalize the metrics for multiclass classifiers. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load and prepare data # ===================== diff --git a/examples/model_selection/plot_successive_halving_heatmap.py b/examples/model_selection/plot_successive_halving_heatmap.py index 9b079e4b1351f..4d9b676443e5e 100644 --- a/examples/model_selection/plot_successive_halving_heatmap.py +++ b/examples/model_selection/plot_successive_halving_heatmap.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from time import time import matplotlib.pyplot as plt diff --git a/examples/model_selection/plot_successive_halving_iterations.py b/examples/model_selection/plot_successive_halving_iterations.py index 31805d308e269..31c1a0b9d5b34 100644 --- a/examples/model_selection/plot_successive_halving_iterations.py +++ b/examples/model_selection/plot_successive_halving_iterations.py @@ -10,6 +10,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np import pandas as pd diff --git a/examples/model_selection/plot_tuned_decision_threshold.py b/examples/model_selection/plot_tuned_decision_threshold.py index 7e997ee255e4d..59986a3910d00 100644 --- a/examples/model_selection/plot_tuned_decision_threshold.py +++ b/examples/model_selection/plot_tuned_decision_threshold.py @@ -14,6 +14,9 @@ threshold, depending on a metric of interest. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # The diabetes dataset # -------------------- diff --git a/examples/model_selection/plot_underfitting_overfitting.py b/examples/model_selection/plot_underfitting_overfitting.py index 412946fc9ca8b..a6151cd6b3c20 100644 --- a/examples/model_selection/plot_underfitting_overfitting.py +++ b/examples/model_selection/plot_underfitting_overfitting.py @@ -21,6 +21,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/model_selection/plot_validation_curve.py b/examples/model_selection/plot_validation_curve.py index 947d8ac2b2fdb..44a382fed0c17 100644 --- a/examples/model_selection/plot_validation_curve.py +++ b/examples/model_selection/plot_validation_curve.py @@ -13,6 +13,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/multiclass/plot_multiclass_overview.py b/examples/multiclass/plot_multiclass_overview.py index 9ef5405512b67..1a0fddc40571d 100644 --- a/examples/multiclass/plot_multiclass_overview.py +++ b/examples/multiclass/plot_multiclass_overview.py @@ -20,6 +20,9 @@ will review them. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # The Yeast UCI dataset # --------------------- diff --git a/examples/neighbors/plot_caching_nearest_neighbors.py b/examples/neighbors/plot_caching_nearest_neighbors.py index f5c3ea200943f..ea6a884c3d486 100644 --- a/examples/neighbors/plot_caching_nearest_neighbors.py +++ b/examples/neighbors/plot_caching_nearest_neighbors.py @@ -20,6 +20,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + from tempfile import TemporaryDirectory import matplotlib.pyplot as plt diff --git a/examples/neighbors/plot_classification.py b/examples/neighbors/plot_classification.py index 43c45558054cf..1754869943ac7 100644 --- a/examples/neighbors/plot_classification.py +++ b/examples/neighbors/plot_classification.py @@ -8,6 +8,9 @@ decision boundary obtained with regards to the parameter `weights`. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load the data # ------------- diff --git a/examples/neighbors/plot_digits_kde_sampling.py b/examples/neighbors/plot_digits_kde_sampling.py index 045058eab09cc..d4860f117e4e9 100644 --- a/examples/neighbors/plot_digits_kde_sampling.py +++ b/examples/neighbors/plot_digits_kde_sampling.py @@ -11,6 +11,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/neighbors/plot_kde_1d.py b/examples/neighbors/plot_kde_1d.py index fc5b1914f23de..ed5a454e476ad 100644 --- a/examples/neighbors/plot_kde_1d.py +++ b/examples/neighbors/plot_kde_1d.py @@ -28,8 +28,9 @@ """ -# Author: Jake Vanderplas -# +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np from scipy.stats import norm diff --git a/examples/neighbors/plot_lof_novelty_detection.py b/examples/neighbors/plot_lof_novelty_detection.py index 789efa66c7b5c..9743ec4e3df2f 100644 --- a/examples/neighbors/plot_lof_novelty_detection.py +++ b/examples/neighbors/plot_lof_novelty_detection.py @@ -25,6 +25,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib import matplotlib.lines as mlines import matplotlib.pyplot as plt diff --git a/examples/neighbors/plot_lof_outlier_detection.py b/examples/neighbors/plot_lof_outlier_detection.py index edb79294ce594..9b5e92579625b 100644 --- a/examples/neighbors/plot_lof_outlier_detection.py +++ b/examples/neighbors/plot_lof_outlier_detection.py @@ -22,6 +22,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Generate data with outliers # --------------------------- diff --git a/examples/neighbors/plot_nca_classification.py b/examples/neighbors/plot_nca_classification.py index 0703caf90056e..b8d69b82fec42 100644 --- a/examples/neighbors/plot_nca_classification.py +++ b/examples/neighbors/plot_nca_classification.py @@ -15,6 +15,7 @@ """ +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/neighbors/plot_nca_dim_reduction.py b/examples/neighbors/plot_nca_dim_reduction.py index 415618f6bc4c7..fcf2b0f602d20 100644 --- a/examples/neighbors/plot_nca_dim_reduction.py +++ b/examples/neighbors/plot_nca_dim_reduction.py @@ -28,6 +28,7 @@ """ +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/neighbors/plot_nca_illustration.py b/examples/neighbors/plot_nca_illustration.py index 7085817f4e9fa..e67bdb4b2d4d7 100644 --- a/examples/neighbors/plot_nca_illustration.py +++ b/examples/neighbors/plot_nca_illustration.py @@ -10,6 +10,7 @@ """ +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/neighbors/plot_nearest_centroid.py b/examples/neighbors/plot_nearest_centroid.py index c8f710d0a0377..1718e213f9252 100644 --- a/examples/neighbors/plot_nearest_centroid.py +++ b/examples/neighbors/plot_nearest_centroid.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import ListedColormap diff --git a/examples/neural_networks/plot_mlp_training_curves.py b/examples/neural_networks/plot_mlp_training_curves.py index 8ee285877caa8..7b63d0de1adfe 100644 --- a/examples/neural_networks/plot_mlp_training_curves.py +++ b/examples/neural_networks/plot_mlp_training_curves.py @@ -14,6 +14,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings import matplotlib.pyplot as plt diff --git a/examples/neural_networks/plot_mnist_filters.py b/examples/neural_networks/plot_mnist_filters.py index f37452a757d20..889e78e2e5e5b 100644 --- a/examples/neural_networks/plot_mnist_filters.py +++ b/examples/neural_networks/plot_mnist_filters.py @@ -24,6 +24,9 @@ to build this documentation on a regular basis. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings import matplotlib.pyplot as plt diff --git a/examples/preprocessing/plot_discretization_classification.py b/examples/preprocessing/plot_discretization_classification.py index 04a461a61799f..1eeb9f169bf3b 100644 --- a/examples/preprocessing/plot_discretization_classification.py +++ b/examples/preprocessing/plot_discretization_classification.py @@ -28,9 +28,7 @@ """ -# Code source: Tom Dupré la Tour -# Adapted from plot_classifier_comparison by Gaël Varoquaux and Andreas Müller -# +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/preprocessing/plot_target_encoder.py b/examples/preprocessing/plot_target_encoder.py index 98b73a9529679..04f3222d4e512 100644 --- a/examples/preprocessing/plot_target_encoder.py +++ b/examples/preprocessing/plot_target_encoder.py @@ -16,6 +16,9 @@ :ref:`User Guide `. for details. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Loading Data from OpenML # ======================== diff --git a/examples/preprocessing/plot_target_encoder_cross_val.py b/examples/preprocessing/plot_target_encoder_cross_val.py index 7244a1bf61cd6..3d51664710096 100644 --- a/examples/preprocessing/plot_target_encoder_cross_val.py +++ b/examples/preprocessing/plot_target_encoder_cross_val.py @@ -16,6 +16,9 @@ fitting procedure to prevent overfitting. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Create Synthetic Dataset # ======================== diff --git a/examples/release_highlights/plot_release_highlights_0_22_0.py b/examples/release_highlights/plot_release_highlights_0_22_0.py index 03120c781140c..8d5648188f0fe 100644 --- a/examples/release_highlights/plot_release_highlights_0_22_0.py +++ b/examples/release_highlights/plot_release_highlights_0_22_0.py @@ -20,6 +20,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # New plotting API # ---------------- diff --git a/examples/semi_supervised/plot_semi_supervised_newsgroups.py b/examples/semi_supervised/plot_semi_supervised_newsgroups.py index 19bcb13c5a99b..1ad7bf85953e7 100644 --- a/examples/semi_supervised/plot_semi_supervised_newsgroups.py +++ b/examples/semi_supervised/plot_semi_supervised_newsgroups.py @@ -11,6 +11,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from sklearn.datasets import fetch_20newsgroups diff --git a/examples/svm/plot_custom_kernel.py b/examples/svm/plot_custom_kernel.py index cacd67ed056ac..d3816849f73b8 100644 --- a/examples/svm/plot_custom_kernel.py +++ b/examples/svm/plot_custom_kernel.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/svm/plot_iris_svc.py b/examples/svm/plot_iris_svc.py index d13a9fe49c803..77259f9d1ea2c 100644 --- a/examples/svm/plot_iris_svc.py +++ b/examples/svm/plot_iris_svc.py @@ -34,6 +34,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn import datasets, svm diff --git a/examples/svm/plot_linearsvc_support_vectors.py b/examples/svm/plot_linearsvc_support_vectors.py index 7f82b6c8bb0fe..021e1c6b55962 100644 --- a/examples/svm/plot_linearsvc_support_vectors.py +++ b/examples/svm/plot_linearsvc_support_vectors.py @@ -9,6 +9,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/svm/plot_oneclass.py b/examples/svm/plot_oneclass.py index 4f44f42fe338e..0db71966db6a9 100644 --- a/examples/svm/plot_oneclass.py +++ b/examples/svm/plot_oneclass.py @@ -11,6 +11,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% import numpy as np diff --git a/examples/svm/plot_rbf_parameters.py b/examples/svm/plot_rbf_parameters.py index ba0154b477b46..356707e2d72b2 100644 --- a/examples/svm/plot_rbf_parameters.py +++ b/examples/svm/plot_rbf_parameters.py @@ -75,6 +75,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Utility class to move the midpoint of a colormap to be around # the values of interest. diff --git a/examples/svm/plot_separating_hyperplane.py b/examples/svm/plot_separating_hyperplane.py index 23f464169f516..842da314feb1a 100644 --- a/examples/svm/plot_separating_hyperplane.py +++ b/examples/svm/plot_separating_hyperplane.py @@ -9,6 +9,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn import svm diff --git a/examples/svm/plot_separating_hyperplane_unbalanced.py b/examples/svm/plot_separating_hyperplane_unbalanced.py index f9c615cc43d4f..d0814e1af065f 100644 --- a/examples/svm/plot_separating_hyperplane_unbalanced.py +++ b/examples/svm/plot_separating_hyperplane_unbalanced.py @@ -25,6 +25,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.lines as mlines import matplotlib.pyplot as plt diff --git a/examples/svm/plot_svm_anova.py b/examples/svm/plot_svm_anova.py index 3d5a934bf4884..1c2a78e79fdb9 100644 --- a/examples/svm/plot_svm_anova.py +++ b/examples/svm/plot_svm_anova.py @@ -10,6 +10,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # Load some data to play with # --------------------------- diff --git a/examples/svm/plot_svm_kernels.py b/examples/svm/plot_svm_kernels.py index 9d859864084f0..798e62bbb7b4e 100644 --- a/examples/svm/plot_svm_kernels.py +++ b/examples/svm/plot_svm_kernels.py @@ -36,7 +36,7 @@ kernel (`"rbf"`) and the sigmoid kernel (`"sigmoid"`). """ -# Code source: Gaël Varoquaux +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # %% diff --git a/examples/svm/plot_svm_margin.py b/examples/svm/plot_svm_margin.py index de293f61b848d..f38858bb714a9 100644 --- a/examples/svm/plot_svm_margin.py +++ b/examples/svm/plot_svm_margin.py @@ -13,8 +13,7 @@ """ -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/svm/plot_svm_regression.py b/examples/svm/plot_svm_regression.py index ab34528a37af6..5da00ef1f88b7 100644 --- a/examples/svm/plot_svm_regression.py +++ b/examples/svm/plot_svm_regression.py @@ -7,6 +7,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/svm/plot_svm_tie_breaking.py b/examples/svm/plot_svm_tie_breaking.py index 0a43d4125aec5..b5f4fb8dd18c3 100644 --- a/examples/svm/plot_svm_tie_breaking.py +++ b/examples/svm/plot_svm_tie_breaking.py @@ -14,7 +14,7 @@ """ -# Code source: Andreas Mueller, Adrin Jalali +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt diff --git a/examples/svm/plot_weighted_samples.py b/examples/svm/plot_weighted_samples.py index c17742e091390..0fb5bedd6e59b 100644 --- a/examples/svm/plot_weighted_samples.py +++ b/examples/svm/plot_weighted_samples.py @@ -14,6 +14,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/tree/plot_cost_complexity_pruning.py b/examples/tree/plot_cost_complexity_pruning.py index b232389ea9ded..bdd1a2b0c358f 100644 --- a/examples/tree/plot_cost_complexity_pruning.py +++ b/examples/tree/plot_cost_complexity_pruning.py @@ -17,6 +17,9 @@ See also :ref:`minimal_cost_complexity_pruning` for details on pruning. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt from sklearn.datasets import load_breast_cancer diff --git a/examples/tree/plot_iris_dtc.py b/examples/tree/plot_iris_dtc.py index 61c3bec3460ed..9d4298919d515 100644 --- a/examples/tree/plot_iris_dtc.py +++ b/examples/tree/plot_iris_dtc.py @@ -15,6 +15,9 @@ We also show the tree structure of a model built on all of the features. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # %% # First load the copy of the Iris dataset shipped with scikit-learn: from sklearn.datasets import load_iris diff --git a/examples/tree/plot_tree_regression.py b/examples/tree/plot_tree_regression.py index 5a3da0b7b6d06..c499e95f428c4 100644 --- a/examples/tree/plot_tree_regression.py +++ b/examples/tree/plot_tree_regression.py @@ -14,6 +14,9 @@ details of the training data and learn from the noise, i.e. they overfit. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # Import the necessary modules and libraries import matplotlib.pyplot as plt import numpy as np diff --git a/examples/tree/plot_tree_regression_multioutput.py b/examples/tree/plot_tree_regression_multioutput.py index b6d2800d2732d..0fed498c0087e 100644 --- a/examples/tree/plot_tree_regression_multioutput.py +++ b/examples/tree/plot_tree_regression_multioutput.py @@ -15,6 +15,9 @@ details of the training data and learn from the noise, i.e. they overfit. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/tree/plot_unveil_tree_structure.py b/examples/tree/plot_unveil_tree_structure.py index 508c3c304f4d9..152fff76cf880 100644 --- a/examples/tree/plot_unveil_tree_structure.py +++ b/examples/tree/plot_unveil_tree_structure.py @@ -16,6 +16,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from matplotlib import pyplot as plt diff --git a/pyproject.toml b/pyproject.toml index 2683e1b18036f..5cd7cd9b54391 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,7 +81,7 @@ tests = [ "pandas>=1.1.5", "pytest>=7.1.2", "pytest-cov>=2.9.0", - "ruff>=0.2.1", + "ruff>=0.5.1", "black>=24.3.0", "mypy>=1.9", "pyamg>=4.0.0", @@ -140,8 +140,12 @@ exclude=[ ] [tool.ruff.lint] +# This enables us to use CPY001: copyright header check +preview = true +# This enables us to use the explicit preview rules that we want only +explicit-preview-rules = true # all rules can be found here: https://beta.ruff.rs/docs/rules/ -select = ["E", "F", "W", "I"] +select = ["E", "F", "W", "I", "CPY001"] ignore=[ # space before : (needed for how black formats slicing) "E203", @@ -149,13 +153,37 @@ ignore=[ "E731", # do not use variables named 'l', 'O', or 'I' "E741", + # E721 is in preview (july 2024) and gives many false positives. + # Use `is` and `is not` for type comparisons, or `isinstance()` for + # isinstance checks + "E721", + # F841 is in preview (july 2024), and we don't care much about it. + # Local variable ... is assigned to but never used + "F841", ] +[tool.ruff.lint.flake8-copyright] +notice-rgx = "\\#\\ Authors:\\ The\\ scikit\\-learn\\ developers\\\n\\#\\ SPDX\\-License\\-Identifier:\\ BSD\\-3\\-Clause\\\n" + [tool.ruff.lint.per-file-ignores] # It's fine not to put the import at the top of the file in the examples # folder. "examples/*"=["E402"] "doc/conf.py"=["E402"] +"**/tests/*"=["CPY001"] +"asv_benchmarks/*"=["CPY001"] +"benchmarks/*"=["CPY001"] +"doc/*"=["CPY001"] +"build_tools/*"=["CPY001"] +"sklearn/_build_utils/*"=["CPY001"] +"maint_tools/*"=["CPY001"] +".spin/*"=["CPY001"] +".github/*"=["CPY001"] +# __doc__ is too long (>4096 chars) and therefore false positive on copyright check +"examples/model_selection/plot_precision_recall.py"=["CPY001"] +"examples/svm/plot_rbf_parameters.py"=["CPY001"] +# __all__ has un-imported names +"sklearn/__init__.py"=["F822"] [tool.cython-lint] diff --git a/sklearn/__check_build/__init__.py b/sklearn/__check_build/__init__.py index f8a739b694579..e50f5b7ec512f 100644 --- a/sklearn/__check_build/__init__.py +++ b/sklearn/__check_build/__init__.py @@ -2,6 +2,9 @@ compile scikit-learn properly. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import os INPLACE_MSG = """ diff --git a/sklearn/__init__.py b/sklearn/__init__.py index a61a2afde8855..03b375a47335e 100644 --- a/sklearn/__init__.py +++ b/sklearn/__init__.py @@ -1,5 +1,8 @@ """Configure global settings and get information about the working environment.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # Machine learning module for Python # ================================== # diff --git a/sklearn/_build_utils/tempita.py b/sklearn/_build_utils/tempita.py index 8da4b9c0e7ace..c92ea17d2a9b9 100644 --- a/sklearn/_build_utils/tempita.py +++ b/sklearn/_build_utils/tempita.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import argparse import os diff --git a/sklearn/_build_utils/version.py b/sklearn/_build_utils/version.py index 124c6cc3a0cdc..922a14917bf3f 100644 --- a/sklearn/_build_utils/version.py +++ b/sklearn/_build_utils/version.py @@ -1,6 +1,9 @@ #!/usr/bin/env python3 """Extract version number from __init__.py""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import os sklearn_init = os.path.join(os.path.dirname(__file__), "../__init__.py") diff --git a/sklearn/_config.py b/sklearn/_config.py index fc9392de68df6..05549c88a9ddc 100644 --- a/sklearn/_config.py +++ b/sklearn/_config.py @@ -1,5 +1,8 @@ """Global configuration state and functions for management""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import os import threading from contextlib import contextmanager as contextmanager diff --git a/sklearn/_distributor_init.py b/sklearn/_distributor_init.py index f0901034e83e4..d66d5d36955c1 100644 --- a/sklearn/_distributor_init.py +++ b/sklearn/_distributor_init.py @@ -8,3 +8,6 @@ The scikit-learn standard source distribution will not put code in this file, so you can safely replace this file with your own version. """ + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/_loss/__init__.py b/sklearn/_loss/__init__.py index ee15e693c16f6..bc348bbca8a15 100644 --- a/sklearn/_loss/__init__.py +++ b/sklearn/_loss/__init__.py @@ -3,6 +3,9 @@ fitting classification and regression tasks. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from .loss import ( AbsoluteError, HalfBinomialLoss, diff --git a/sklearn/_loss/link.py b/sklearn/_loss/link.py index a6560d58d91e6..53dff6c2e9285 100644 --- a/sklearn/_loss/link.py +++ b/sklearn/_loss/link.py @@ -2,7 +2,8 @@ Module contains classes for invertible (and differentiable) link functions. """ -# Author: Christian Lorentzen +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause from abc import ABC, abstractmethod from dataclasses import dataclass diff --git a/sklearn/_loss/loss.py b/sklearn/_loss/loss.py index 96863cc00fe01..b45ff3322699a 100644 --- a/sklearn/_loss/loss.py +++ b/sklearn/_loss/loss.py @@ -6,6 +6,9 @@ classification. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # Goals: # - Provide a common private module for loss functions/classes. # - To be used in: diff --git a/sklearn/_min_dependencies.py b/sklearn/_min_dependencies.py index 2003ccdea1abc..d385281fb2b69 100644 --- a/sklearn/_min_dependencies.py +++ b/sklearn/_min_dependencies.py @@ -1,5 +1,8 @@ """All minimum dependencies for scikit-learn.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import argparse from collections import defaultdict @@ -29,7 +32,7 @@ "memory_profiler": ("0.57.0", "benchmark, docs"), "pytest": (PYTEST_MIN_VERSION, "tests"), "pytest-cov": ("2.9.0", "tests"), - "ruff": ("0.2.1", "tests"), + "ruff": ("0.5.1", "tests"), "black": ("24.3.0", "tests"), "mypy": ("1.9", "tests"), "pyamg": ("4.0.0", "tests"), diff --git a/sklearn/cluster/__init__.py b/sklearn/cluster/__init__.py index 5d497d2976ad1..a0545d3b90d56 100644 --- a/sklearn/cluster/__init__.py +++ b/sklearn/cluster/__init__.py @@ -1,5 +1,8 @@ """Popular unsupervised clustering algorithms.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._affinity_propagation import AffinityPropagation, affinity_propagation from ._agglomerative import ( AgglomerativeClustering, diff --git a/sklearn/cluster/_agglomerative.py b/sklearn/cluster/_agglomerative.py index 55215d2a0312c..68fa315f11634 100644 --- a/sklearn/cluster/_agglomerative.py +++ b/sklearn/cluster/_agglomerative.py @@ -8,6 +8,9 @@ License: BSD 3 clause """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings from heapq import heapify, heappop, heappush, heappushpop from numbers import Integral, Real diff --git a/sklearn/cluster/_bisect_k_means.py b/sklearn/cluster/_bisect_k_means.py index 1d4a9e1d84c26..134d998c90a92 100644 --- a/sklearn/cluster/_bisect_k_means.py +++ b/sklearn/cluster/_bisect_k_means.py @@ -1,6 +1,7 @@ """Bisecting K-means clustering.""" -# Author: Michal Krawczyk +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import warnings diff --git a/sklearn/cluster/_hdbscan/__init__.py b/sklearn/cluster/_hdbscan/__init__.py index e69de29bb2d1d..67dd18fb94b59 100644 --- a/sklearn/cluster/_hdbscan/__init__.py +++ b/sklearn/cluster/_hdbscan/__init__.py @@ -0,0 +1,2 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/cluster/_hdbscan/hdbscan.py b/sklearn/cluster/_hdbscan/hdbscan.py index 8caa639a6de69..6578f53745f45 100644 --- a/sklearn/cluster/_hdbscan/hdbscan.py +++ b/sklearn/cluster/_hdbscan/hdbscan.py @@ -3,6 +3,9 @@ of Applications with Noise """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # Authors: Leland McInnes # Steve Astels # John Healy diff --git a/sklearn/cluster/_mean_shift.py b/sklearn/cluster/_mean_shift.py index a99a607f3cf0d..900494536381a 100644 --- a/sklearn/cluster/_mean_shift.py +++ b/sklearn/cluster/_mean_shift.py @@ -9,10 +9,8 @@ Seeding is performed using a binning technique for scalability. """ -# Authors: Conrad Lee -# Alexandre Gramfort -# Gael Varoquaux -# Martino Sorbaro +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import warnings from collections import defaultdict diff --git a/sklearn/cluster/_optics.py b/sklearn/cluster/_optics.py index b2a0c4d642a00..46f795e94ffb2 100755 --- a/sklearn/cluster/_optics.py +++ b/sklearn/cluster/_optics.py @@ -10,6 +10,9 @@ License: BSD 3 clause """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings from numbers import Integral, Real diff --git a/sklearn/cluster/tests/test_feature_agglomeration.py b/sklearn/cluster/tests/test_feature_agglomeration.py index 488dd638ad125..ef8596c0813f8 100644 --- a/sklearn/cluster/tests/test_feature_agglomeration.py +++ b/sklearn/cluster/tests/test_feature_agglomeration.py @@ -2,7 +2,6 @@ Tests for sklearn.cluster._feature_agglomeration """ -# Authors: Sergul Aydore 2017 import warnings import numpy as np diff --git a/sklearn/cluster/tests/test_hierarchical.py b/sklearn/cluster/tests/test_hierarchical.py index a36e5537a3636..65f8184e3f444 100644 --- a/sklearn/cluster/tests/test_hierarchical.py +++ b/sklearn/cluster/tests/test_hierarchical.py @@ -5,6 +5,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import itertools import shutil from functools import partial diff --git a/sklearn/cluster/tests/test_optics.py b/sklearn/cluster/tests/test_optics.py index 9c1c13a9e12e0..95324704f6371 100644 --- a/sklearn/cluster/tests/test_optics.py +++ b/sklearn/cluster/tests/test_optics.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import warnings import numpy as np diff --git a/sklearn/compose/__init__.py b/sklearn/compose/__init__.py index e6e8fc6fd2c1b..9f20bc9856074 100644 --- a/sklearn/compose/__init__.py +++ b/sklearn/compose/__init__.py @@ -5,6 +5,9 @@ :class:`~sklearn.pipeline.FeatureUnion`. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._column_transformer import ( ColumnTransformer, make_column_selector, diff --git a/sklearn/compose/_column_transformer.py b/sklearn/compose/_column_transformer.py index a5aa7db17d4ae..5e08a68b63c16 100644 --- a/sklearn/compose/_column_transformer.py +++ b/sklearn/compose/_column_transformer.py @@ -6,6 +6,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import warnings from collections import Counter, UserList from itertools import chain diff --git a/sklearn/conftest.py b/sklearn/conftest.py index 47b6c2887acef..a22c2ec5d39f6 100644 --- a/sklearn/conftest.py +++ b/sklearn/conftest.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import builtins import platform import sys diff --git a/sklearn/covariance/__init__.py b/sklearn/covariance/__init__.py index 19ee1d8a09759..989f3372b42e0 100644 --- a/sklearn/covariance/__init__.py +++ b/sklearn/covariance/__init__.py @@ -5,6 +5,9 @@ closely related to the theory of Gaussian graphical models. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._elliptic_envelope import EllipticEnvelope from ._empirical_covariance import ( EmpiricalCovariance, diff --git a/sklearn/covariance/_graph_lasso.py b/sklearn/covariance/_graph_lasso.py index 2007aa4085bd2..1de2aeee6c590 100644 --- a/sklearn/covariance/_graph_lasso.py +++ b/sklearn/covariance/_graph_lasso.py @@ -4,6 +4,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import operator import sys import time diff --git a/sklearn/cross_decomposition/__init__.py b/sklearn/cross_decomposition/__init__.py index 15eb21467daee..cad873ed800c6 100644 --- a/sklearn/cross_decomposition/__init__.py +++ b/sklearn/cross_decomposition/__init__.py @@ -1,5 +1,8 @@ """Algorithms for cross decomposition.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._pls import CCA, PLSSVD, PLSCanonical, PLSRegression __all__ = ["PLSCanonical", "PLSRegression", "PLSSVD", "CCA"] diff --git a/sklearn/datasets/__init__.py b/sklearn/datasets/__init__.py index f41b8fa7e73fb..18c3cea4ea342 100644 --- a/sklearn/datasets/__init__.py +++ b/sklearn/datasets/__init__.py @@ -1,5 +1,8 @@ """Utilities to load popular datasets and artificial data generators.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import textwrap from ._base import ( diff --git a/sklearn/datasets/_arff_parser.py b/sklearn/datasets/_arff_parser.py index 86dfeb37a6ef5..fb6e629a73c8d 100644 --- a/sklearn/datasets/_arff_parser.py +++ b/sklearn/datasets/_arff_parser.py @@ -1,5 +1,8 @@ """Implementation of ARFF parsers: via LIAC-ARFF and pandas.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import itertools import re from collections import OrderedDict diff --git a/sklearn/datasets/_base.py b/sklearn/datasets/_base.py index 62055d296402b..aaf3d738f85f4 100644 --- a/sklearn/datasets/_base.py +++ b/sklearn/datasets/_base.py @@ -4,6 +4,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import csv import gzip import hashlib diff --git a/sklearn/datasets/_kddcup99.py b/sklearn/datasets/_kddcup99.py index 597fb9c9dece3..ab4db0522ef20 100644 --- a/sklearn/datasets/_kddcup99.py +++ b/sklearn/datasets/_kddcup99.py @@ -8,6 +8,9 @@ """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import errno import logging import os diff --git a/sklearn/datasets/_openml.py b/sklearn/datasets/_openml.py index a423928ffff40..4790431506bce 100644 --- a/sklearn/datasets/_openml.py +++ b/sklearn/datasets/_openml.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import gzip import hashlib import json diff --git a/sklearn/datasets/data/__init__.py b/sklearn/datasets/data/__init__.py index e69de29bb2d1d..67dd18fb94b59 100644 --- a/sklearn/datasets/data/__init__.py +++ b/sklearn/datasets/data/__init__.py @@ -0,0 +1,2 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/datasets/descr/__init__.py b/sklearn/datasets/descr/__init__.py index e69de29bb2d1d..67dd18fb94b59 100644 --- a/sklearn/datasets/descr/__init__.py +++ b/sklearn/datasets/descr/__init__.py @@ -0,0 +1,2 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/datasets/images/__init__.py b/sklearn/datasets/images/__init__.py index e69de29bb2d1d..67dd18fb94b59 100644 --- a/sklearn/datasets/images/__init__.py +++ b/sklearn/datasets/images/__init__.py @@ -0,0 +1,2 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/decomposition/__init__.py b/sklearn/decomposition/__init__.py index 4730bda31ebbd..cd013fe9c7a93 100644 --- a/sklearn/decomposition/__init__.py +++ b/sklearn/decomposition/__init__.py @@ -4,6 +4,9 @@ regarded as dimensionality reduction techniques. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ..utils.extmath import randomized_svd from ._dict_learning import ( DictionaryLearning, diff --git a/sklearn/decomposition/_lda.py b/sklearn/decomposition/_lda.py index 37b425a727a88..ed48eb8befa63 100644 --- a/sklearn/decomposition/_lda.py +++ b/sklearn/decomposition/_lda.py @@ -8,8 +8,9 @@ Link: https://github.com/blei-lab/onlineldavb """ -# Author: Chyi-Kwei Yau -# Author: Matthew D. Hoffman (original onlineldavb implementation) +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from numbers import Integral, Real import numpy as np diff --git a/sklearn/decomposition/_truncated_svd.py b/sklearn/decomposition/_truncated_svd.py index d978191f104f7..a68e96fdd0c03 100644 --- a/sklearn/decomposition/_truncated_svd.py +++ b/sklearn/decomposition/_truncated_svd.py @@ -1,9 +1,7 @@ """Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).""" -# Author: Lars Buitinck -# Olivier Grisel -# Michael Becker -# License: 3-clause BSD. +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause from numbers import Integral, Real diff --git a/sklearn/ensemble/__init__.py b/sklearn/ensemble/__init__.py index e49d744ed6391..2a8cf413be9da 100644 --- a/sklearn/ensemble/__init__.py +++ b/sklearn/ensemble/__init__.py @@ -1,5 +1,8 @@ """Ensemble-based methods for classification, regression and anomaly detection.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._bagging import BaggingClassifier, BaggingRegressor from ._base import BaseEnsemble from ._forest import ( diff --git a/sklearn/ensemble/_hist_gradient_boosting/__init__.py b/sklearn/ensemble/_hist_gradient_boosting/__init__.py index 879fae1189f87..5939d83c84838 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/__init__.py +++ b/sklearn/ensemble/_hist_gradient_boosting/__init__.py @@ -3,3 +3,6 @@ The implementation is a port from pygbm which is itself strongly inspired from LightGBM. """ + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/ensemble/_hist_gradient_boosting/binning.py b/sklearn/ensemble/_hist_gradient_boosting/binning.py index 8e37d70a6b2f7..ed1bca8558f81 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/binning.py +++ b/sklearn/ensemble/_hist_gradient_boosting/binning.py @@ -6,7 +6,8 @@ approximately the same number of samples. """ -# Author: Nicolas Hug +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import numpy as np diff --git a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py index 990834a626f89..8db6f7e4d5ff4 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py +++ b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py @@ -1,6 +1,7 @@ """Fast Gradient Boosting decision trees for classification and regression.""" -# Author: Nicolas Hug +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import itertools import warnings diff --git a/sklearn/ensemble/_hist_gradient_boosting/grower.py b/sklearn/ensemble/_hist_gradient_boosting/grower.py index 419e2f26c2653..a71e564056f8f 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/grower.py +++ b/sklearn/ensemble/_hist_gradient_boosting/grower.py @@ -5,7 +5,8 @@ the gradients and hessians of the training data. """ -# Author: Nicolas Hug +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import numbers from heapq import heappop, heappush diff --git a/sklearn/ensemble/_hist_gradient_boosting/predictor.py b/sklearn/ensemble/_hist_gradient_boosting/predictor.py index 799c25aadcec3..59bb6499c4501 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/predictor.py +++ b/sklearn/ensemble/_hist_gradient_boosting/predictor.py @@ -2,7 +2,8 @@ This module contains the TreePredictor class which is used for prediction. """ -# Author: Nicolas Hug +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import numpy as np diff --git a/sklearn/ensemble/_hist_gradient_boosting/utils.py b/sklearn/ensemble/_hist_gradient_boosting/utils.py index 1ff17217164c8..429fbed611c22 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/utils.py +++ b/sklearn/ensemble/_hist_gradient_boosting/utils.py @@ -1,5 +1,8 @@ """This module contains utility routines.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ...base import is_classifier from .binning import _BinMapper diff --git a/sklearn/ensemble/tests/test_bagging.py b/sklearn/ensemble/tests/test_bagging.py index e0558917c59ba..4b1c4323d509a 100644 --- a/sklearn/ensemble/tests/test_bagging.py +++ b/sklearn/ensemble/tests/test_bagging.py @@ -4,6 +4,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + from itertools import cycle, product import joblib diff --git a/sklearn/exceptions.py b/sklearn/exceptions.py index 7f6b26163cc87..caba4e174817a 100644 --- a/sklearn/exceptions.py +++ b/sklearn/exceptions.py @@ -1,5 +1,8 @@ """Custom warnings and errors used across scikit-learn.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + __all__ = [ "NotFittedError", "ConvergenceWarning", diff --git a/sklearn/experimental/__init__.py b/sklearn/experimental/__init__.py index 205a11a3d524b..593d247e5bc40 100644 --- a/sklearn/experimental/__init__.py +++ b/sklearn/experimental/__init__.py @@ -5,3 +5,6 @@ The features and estimators that are experimental aren't subject to deprecation cycles. Use them at your own risks! """ + +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/experimental/enable_halving_search_cv.py b/sklearn/experimental/enable_halving_search_cv.py index dd399ef35b6f7..85f93b26459d0 100644 --- a/sklearn/experimental/enable_halving_search_cv.py +++ b/sklearn/experimental/enable_halving_search_cv.py @@ -19,6 +19,9 @@ flake8 to ignore the import, which appears as unused. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from .. import model_selection from ..model_selection._search_successive_halving import ( HalvingGridSearchCV, diff --git a/sklearn/experimental/enable_hist_gradient_boosting.py b/sklearn/experimental/enable_hist_gradient_boosting.py index 6fa4512ce39c6..9269b2d0b6d6c 100644 --- a/sklearn/experimental/enable_hist_gradient_boosting.py +++ b/sklearn/experimental/enable_hist_gradient_boosting.py @@ -7,6 +7,9 @@ normally from `sklearn.ensemble`. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # Don't remove this file, we don't want to break users code just because the # feature isn't experimental anymore. diff --git a/sklearn/experimental/enable_iterative_imputer.py b/sklearn/experimental/enable_iterative_imputer.py index 0b906961ca184..544e0d60eea28 100644 --- a/sklearn/experimental/enable_iterative_imputer.py +++ b/sklearn/experimental/enable_iterative_imputer.py @@ -12,6 +12,9 @@ >>> from sklearn.impute import IterativeImputer """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from .. import impute from ..impute._iterative import IterativeImputer diff --git a/sklearn/feature_extraction/__init__.py b/sklearn/feature_extraction/__init__.py index dced9d46b4cc7..3ca86d86bee68 100644 --- a/sklearn/feature_extraction/__init__.py +++ b/sklearn/feature_extraction/__init__.py @@ -1,6 +1,9 @@ """Feature extraction from raw data.""" -from . import text +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + +from . import image, text from ._dict_vectorizer import DictVectorizer from ._hash import FeatureHasher from .image import grid_to_graph, img_to_graph diff --git a/sklearn/feature_extraction/_stop_words.py b/sklearn/feature_extraction/_stop_words.py index 37ae02a0f36c5..6bc8e6d2f37dc 100644 --- a/sklearn/feature_extraction/_stop_words.py +++ b/sklearn/feature_extraction/_stop_words.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # This list of English stop words is taken from the "Glasgow Information # Retrieval Group". The original list can be found at # http://ir.dcs.gla.ac.uk/resources/linguistic_utils/stop_words diff --git a/sklearn/feature_selection/__init__.py b/sklearn/feature_selection/__init__.py index d431a5b016807..fbb8f54350630 100644 --- a/sklearn/feature_selection/__init__.py +++ b/sklearn/feature_selection/__init__.py @@ -4,6 +4,9 @@ algorithm. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._base import SelectorMixin from ._from_model import SelectFromModel from ._mutual_info import mutual_info_classif, mutual_info_regression diff --git a/sklearn/feature_selection/_mutual_info.py b/sklearn/feature_selection/_mutual_info.py index f3808068f46a5..ede6fa9a21c34 100644 --- a/sklearn/feature_selection/_mutual_info.py +++ b/sklearn/feature_selection/_mutual_info.py @@ -1,5 +1,5 @@ -# Author: Nikolay Mayorov -# License: 3-clause BSD +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause from numbers import Integral diff --git a/sklearn/feature_selection/_sequential.py b/sklearn/feature_selection/_sequential.py index 9c393724f9cea..471f9a373a3da 100644 --- a/sklearn/feature_selection/_sequential.py +++ b/sklearn/feature_selection/_sequential.py @@ -2,6 +2,9 @@ Sequential feature selection """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from numbers import Integral, Real import numpy as np diff --git a/sklearn/feature_selection/_variance_threshold.py b/sklearn/feature_selection/_variance_threshold.py index f97c75db1e34b..7494b72c1acb8 100644 --- a/sklearn/feature_selection/_variance_threshold.py +++ b/sklearn/feature_selection/_variance_threshold.py @@ -1,5 +1,6 @@ -# Author: Lars Buitinck -# License: 3-clause BSD +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from numbers import Real import numpy as np diff --git a/sklearn/impute/__init__.py b/sklearn/impute/__init__.py index a40c6b432d6d5..2f9ed9017c6cb 100644 --- a/sklearn/impute/__init__.py +++ b/sklearn/impute/__init__.py @@ -1,5 +1,8 @@ """Transformers for missing value imputation.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import typing from ._base import MissingIndicator, SimpleImputer diff --git a/sklearn/impute/_iterative.py b/sklearn/impute/_iterative.py index 41f903061c34d..e2d06844611c9 100644 --- a/sklearn/impute/_iterative.py +++ b/sklearn/impute/_iterative.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings from collections import namedtuple from numbers import Integral, Real diff --git a/sklearn/inspection/__init__.py b/sklearn/inspection/__init__.py index 312a19d2c9bce..8bb2b5dc575e9 100644 --- a/sklearn/inspection/__init__.py +++ b/sklearn/inspection/__init__.py @@ -1,5 +1,8 @@ """Tools for model inspection.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._partial_dependence import partial_dependence from ._permutation_importance import permutation_importance from ._plot.decision_boundary import DecisionBoundaryDisplay diff --git a/sklearn/inspection/_pd_utils.py b/sklearn/inspection/_pd_utils.py index 76f4d626fd53c..a48ba4d9a4490 100644 --- a/sklearn/inspection/_pd_utils.py +++ b/sklearn/inspection/_pd_utils.py @@ -1,3 +1,7 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + + def _check_feature_names(X, feature_names=None): """Check feature names. diff --git a/sklearn/inspection/_permutation_importance.py b/sklearn/inspection/_permutation_importance.py index 659db143153cc..8ecd7237b077d 100644 --- a/sklearn/inspection/_permutation_importance.py +++ b/sklearn/inspection/_permutation_importance.py @@ -1,5 +1,8 @@ """Permutation importance for estimators.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numbers import numpy as np diff --git a/sklearn/inspection/_plot/__init__.py b/sklearn/inspection/_plot/__init__.py index e69de29bb2d1d..67dd18fb94b59 100644 --- a/sklearn/inspection/_plot/__init__.py +++ b/sklearn/inspection/_plot/__init__.py @@ -0,0 +1,2 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/inspection/_plot/decision_boundary.py b/sklearn/inspection/_plot/decision_boundary.py index 92e1a2527400e..3a9cc17df72a2 100644 --- a/sklearn/inspection/_plot/decision_boundary.py +++ b/sklearn/inspection/_plot/decision_boundary.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from ...base import is_regressor diff --git a/sklearn/inspection/_plot/partial_dependence.py b/sklearn/inspection/_plot/partial_dependence.py index 3d516d727192e..ecb421ccdd68a 100644 --- a/sklearn/inspection/_plot/partial_dependence.py +++ b/sklearn/inspection/_plot/partial_dependence.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numbers from itertools import chain from math import ceil diff --git a/sklearn/kernel_ridge.py b/sklearn/kernel_ridge.py index 31eade5255e75..443dc7cc9e483 100644 --- a/sklearn/kernel_ridge.py +++ b/sklearn/kernel_ridge.py @@ -2,6 +2,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + from numbers import Real import numpy as np diff --git a/sklearn/linear_model/__init__.py b/sklearn/linear_model/__init__.py index a2b0ffba0e728..182cd94b0260d 100644 --- a/sklearn/linear_model/__init__.py +++ b/sklearn/linear_model/__init__.py @@ -1,5 +1,8 @@ """A variety of linear models.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # See http://scikit-learn.sourceforge.net/modules/sgd.html and # http://scikit-learn.sourceforge.net/modules/linear_model.html for # complete documentation. diff --git a/sklearn/linear_model/_glm/__init__.py b/sklearn/linear_model/_glm/__init__.py index 199b938b023d0..d0a51e65d3211 100644 --- a/sklearn/linear_model/_glm/__init__.py +++ b/sklearn/linear_model/_glm/__init__.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + from .glm import ( GammaRegressor, PoissonRegressor, diff --git a/sklearn/linear_model/_glm/_newton_solver.py b/sklearn/linear_model/_glm/_newton_solver.py index b2be604d931c5..400ac79c7c55c 100644 --- a/sklearn/linear_model/_glm/_newton_solver.py +++ b/sklearn/linear_model/_glm/_newton_solver.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + """ Newton solver for Generalized Linear Models """ diff --git a/sklearn/linear_model/_glm/glm.py b/sklearn/linear_model/_glm/glm.py index 14caa4fd733c2..b8f8d9b11f99b 100644 --- a/sklearn/linear_model/_glm/glm.py +++ b/sklearn/linear_model/_glm/glm.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + """ Generalized Linear Models with Exponential Dispersion Family """ diff --git a/sklearn/linear_model/_glm/tests/test_glm.py b/sklearn/linear_model/_glm/tests/test_glm.py index 7f6ec64c15ad4..bf30b071e290b 100644 --- a/sklearn/linear_model/_glm/tests/test_glm.py +++ b/sklearn/linear_model/_glm/tests/test_glm.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import itertools import warnings from functools import partial diff --git a/sklearn/linear_model/_linear_loss.py b/sklearn/linear_model/_linear_loss.py index e8c1466b30623..cfac0a2739115 100644 --- a/sklearn/linear_model/_linear_loss.py +++ b/sklearn/linear_model/_linear_loss.py @@ -2,6 +2,9 @@ Loss functions for linear models with raw_prediction = X @ coef """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from scipy import sparse diff --git a/sklearn/linear_model/_logistic.py b/sklearn/linear_model/_logistic.py index 23daa86f2146d..fd34daed115e2 100644 --- a/sklearn/linear_model/_logistic.py +++ b/sklearn/linear_model/_logistic.py @@ -2,13 +2,8 @@ Logistic Regression """ -# Author: Gael Varoquaux -# Fabian Pedregosa -# Alexandre Gramfort -# Manoj Kumar -# Lars Buitinck -# Simon Wu -# Arthur Mensch +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import warnings diff --git a/sklearn/metrics/__init__.py b/sklearn/metrics/__init__.py index 81a67d9793bb0..787df39a21979 100644 --- a/sklearn/metrics/__init__.py +++ b/sklearn/metrics/__init__.py @@ -1,5 +1,8 @@ """Score functions, performance metrics, pairwise metrics and distance computations.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from . import cluster from ._classification import ( accuracy_score, diff --git a/sklearn/metrics/_pairwise_distances_reduction/__init__.py b/sklearn/metrics/_pairwise_distances_reduction/__init__.py index 73d291995c31b..926d54ea74217 100644 --- a/sklearn/metrics/_pairwise_distances_reduction/__init__.py +++ b/sklearn/metrics/_pairwise_distances_reduction/__init__.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # # Pairwise Distances Reductions # ============================= diff --git a/sklearn/metrics/_pairwise_distances_reduction/_dispatcher.py b/sklearn/metrics/_pairwise_distances_reduction/_dispatcher.py index 956de3577bcee..d8307cbe84eaa 100644 --- a/sklearn/metrics/_pairwise_distances_reduction/_dispatcher.py +++ b/sklearn/metrics/_pairwise_distances_reduction/_dispatcher.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from abc import abstractmethod from typing import List diff --git a/sklearn/metrics/_plot/__init__.py b/sklearn/metrics/_plot/__init__.py index e69de29bb2d1d..67dd18fb94b59 100644 --- a/sklearn/metrics/_plot/__init__.py +++ b/sklearn/metrics/_plot/__init__.py @@ -0,0 +1,2 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/metrics/_plot/confusion_matrix.py b/sklearn/metrics/_plot/confusion_matrix.py index 01783367649f5..f1c9a8a3e1db5 100644 --- a/sklearn/metrics/_plot/confusion_matrix.py +++ b/sklearn/metrics/_plot/confusion_matrix.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from itertools import product import numpy as np diff --git a/sklearn/metrics/_plot/det_curve.py b/sklearn/metrics/_plot/det_curve.py index e7336b10f5bb6..7a9b68fb2e7e9 100644 --- a/sklearn/metrics/_plot/det_curve.py +++ b/sklearn/metrics/_plot/det_curve.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import scipy as sp from ...utils._plotting import _BinaryClassifierCurveDisplayMixin diff --git a/sklearn/metrics/_plot/precision_recall_curve.py b/sklearn/metrics/_plot/precision_recall_curve.py index 852dbf3981b2c..95698ee43c22b 100644 --- a/sklearn/metrics/_plot/precision_recall_curve.py +++ b/sklearn/metrics/_plot/precision_recall_curve.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from collections import Counter from ...utils._plotting import _BinaryClassifierCurveDisplayMixin diff --git a/sklearn/metrics/_plot/regression.py b/sklearn/metrics/_plot/regression.py index 1a3dfa0127931..11450c8311799 100644 --- a/sklearn/metrics/_plot/regression.py +++ b/sklearn/metrics/_plot/regression.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numbers import numpy as np diff --git a/sklearn/metrics/_plot/roc_curve.py b/sklearn/metrics/_plot/roc_curve.py index 292fb6e2e2f69..e9d4ca5d5672d 100644 --- a/sklearn/metrics/_plot/roc_curve.py +++ b/sklearn/metrics/_plot/roc_curve.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ...utils._plotting import _BinaryClassifierCurveDisplayMixin from .._ranking import auc, roc_curve diff --git a/sklearn/metrics/_scorer.py b/sklearn/metrics/_scorer.py index bbc1424c335fb..b735da25d577c 100644 --- a/sklearn/metrics/_scorer.py +++ b/sklearn/metrics/_scorer.py @@ -13,10 +13,8 @@ ground truth labeling (or ``None`` in the case of unsupervised models). """ -# Authors: Andreas Mueller -# Lars Buitinck -# Arnaud Joly -# License: Simplified BSD +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause import copy import warnings diff --git a/sklearn/metrics/cluster/__init__.py b/sklearn/metrics/cluster/__init__.py index 776b2f2dbd063..47c7ae161edf2 100644 --- a/sklearn/metrics/cluster/__init__.py +++ b/sklearn/metrics/cluster/__init__.py @@ -5,6 +5,9 @@ model itself. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._bicluster import consensus_score from ._supervised import ( adjusted_mutual_info_score, diff --git a/sklearn/metrics/cluster/_bicluster.py b/sklearn/metrics/cluster/_bicluster.py index ad2153878b37e..b718a5a226598 100644 --- a/sklearn/metrics/cluster/_bicluster.py +++ b/sklearn/metrics/cluster/_bicluster.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from scipy.optimize import linear_sum_assignment diff --git a/sklearn/mixture/__init__.py b/sklearn/mixture/__init__.py index 9eb449226a9cb..6832f110e4cc6 100644 --- a/sklearn/mixture/__init__.py +++ b/sklearn/mixture/__init__.py @@ -1,5 +1,8 @@ """Mixture modeling algorithms.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._bayesian_mixture import BayesianGaussianMixture from ._gaussian_mixture import GaussianMixture diff --git a/sklearn/mixture/tests/test_bayesian_mixture.py b/sklearn/mixture/tests/test_bayesian_mixture.py index e23ec5050b70b..d17e6710ee5a7 100644 --- a/sklearn/mixture/tests/test_bayesian_mixture.py +++ b/sklearn/mixture/tests/test_bayesian_mixture.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import copy import numpy as np diff --git a/sklearn/model_selection/__init__.py b/sklearn/model_selection/__init__.py index 8a50d032dc164..55b548ce45814 100644 --- a/sklearn/model_selection/__init__.py +++ b/sklearn/model_selection/__init__.py @@ -1,5 +1,8 @@ """Tools for model selection, such as cross validation and hyper-parameter tuning.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import typing from ._classification_threshold import ( diff --git a/sklearn/model_selection/_classification_threshold.py b/sklearn/model_selection/_classification_threshold.py index 1d221d3388434..820b90f238723 100644 --- a/sklearn/model_selection/_classification_threshold.py +++ b/sklearn/model_selection/_classification_threshold.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from collections.abc import MutableMapping from numbers import Integral, Real diff --git a/sklearn/model_selection/_plot.py b/sklearn/model_selection/_plot.py index 08518cf2482d4..b16e0f4c1019a 100644 --- a/sklearn/model_selection/_plot.py +++ b/sklearn/model_selection/_plot.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from ..utils._optional_dependencies import check_matplotlib_support diff --git a/sklearn/model_selection/_search_successive_halving.py b/sklearn/model_selection/_search_successive_halving.py index b1cf5ee50965c..5980d40cb8e40 100644 --- a/sklearn/model_selection/_search_successive_halving.py +++ b/sklearn/model_selection/_search_successive_halving.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from abc import abstractmethod from copy import deepcopy from math import ceil, floor, log diff --git a/sklearn/naive_bayes.py b/sklearn/naive_bayes.py index 7992a911c1be1..e2d5a3dc24de8 100644 --- a/sklearn/naive_bayes.py +++ b/sklearn/naive_bayes.py @@ -6,6 +6,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import warnings from abc import ABCMeta, abstractmethod from numbers import Integral, Real diff --git a/sklearn/neighbors/__init__.py b/sklearn/neighbors/__init__.py index e2c1a50632564..02c4a28b9a6c4 100644 --- a/sklearn/neighbors/__init__.py +++ b/sklearn/neighbors/__init__.py @@ -1,5 +1,8 @@ """The k-nearest neighbors algorithms.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._ball_tree import BallTree from ._base import VALID_METRICS, VALID_METRICS_SPARSE, sort_graph_by_row_values from ._classification import KNeighborsClassifier, RadiusNeighborsClassifier diff --git a/sklearn/neighbors/_base.py b/sklearn/neighbors/_base.py index 750dd485ed586..3dfd2df16fabd 100644 --- a/sklearn/neighbors/_base.py +++ b/sklearn/neighbors/_base.py @@ -2,6 +2,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import itertools import numbers import warnings diff --git a/sklearn/neighbors/_classification.py b/sklearn/neighbors/_classification.py index c45be05b5fe04..9c88f5f456e0a 100644 --- a/sklearn/neighbors/_classification.py +++ b/sklearn/neighbors/_classification.py @@ -2,6 +2,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import warnings from numbers import Integral diff --git a/sklearn/neighbors/_graph.py b/sklearn/neighbors/_graph.py index d22b25f785e38..7e378b20cbadc 100644 --- a/sklearn/neighbors/_graph.py +++ b/sklearn/neighbors/_graph.py @@ -2,6 +2,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import itertools from ..base import ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context diff --git a/sklearn/neighbors/_kde.py b/sklearn/neighbors/_kde.py index a9e5fe011150a..73c50e848ae2b 100644 --- a/sklearn/neighbors/_kde.py +++ b/sklearn/neighbors/_kde.py @@ -3,7 +3,9 @@ ------------------------- """ -# Author: Jake Vanderplas +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import itertools from numbers import Integral, Real diff --git a/sklearn/neighbors/_regression.py b/sklearn/neighbors/_regression.py index 98a5734c5140b..5b96a64a8bc28 100644 --- a/sklearn/neighbors/_regression.py +++ b/sklearn/neighbors/_regression.py @@ -2,7 +2,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause -# University of Copenhagen import warnings diff --git a/sklearn/neighbors/_unsupervised.py b/sklearn/neighbors/_unsupervised.py index 4185bbe15826b..8888fe18483c6 100644 --- a/sklearn/neighbors/_unsupervised.py +++ b/sklearn/neighbors/_unsupervised.py @@ -1,5 +1,8 @@ """Unsupervised nearest neighbors learner""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ..base import _fit_context from ._base import KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin diff --git a/sklearn/neural_network/__init__.py b/sklearn/neural_network/__init__.py index 7bf5f1241de69..fa5980ce24f5c 100644 --- a/sklearn/neural_network/__init__.py +++ b/sklearn/neural_network/__init__.py @@ -1,5 +1,6 @@ """Models based on neural networks.""" +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from ._multilayer_perceptron import MLPClassifier, MLPRegressor diff --git a/sklearn/preprocessing/__init__.py b/sklearn/preprocessing/__init__.py index 9e49379c9122a..d5ea1fe15f036 100644 --- a/sklearn/preprocessing/__init__.py +++ b/sklearn/preprocessing/__init__.py @@ -1,5 +1,8 @@ """Methods for scaling, centering, normalization, binarization, and more.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._data import ( Binarizer, KernelCenterer, diff --git a/sklearn/preprocessing/_csr_polynomial_expansion.pyx b/sklearn/preprocessing/_csr_polynomial_expansion.pyx index 017af83f035b2..38e5c3069d252 100644 --- a/sklearn/preprocessing/_csr_polynomial_expansion.pyx +++ b/sklearn/preprocessing/_csr_polynomial_expansion.pyx @@ -1,5 +1,6 @@ -# Authors: Andrew nystrom -# Meekail Zain +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ..utils._typedefs cimport uint8_t, int64_t, intp_t ctypedef uint8_t FLAG_t diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index 72884a3366c5d..4dbe1e833322c 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings from functools import partial diff --git a/sklearn/preprocessing/_polynomial.py b/sklearn/preprocessing/_polynomial.py index f4c9fb032cfb0..2175e93e38694 100644 --- a/sklearn/preprocessing/_polynomial.py +++ b/sklearn/preprocessing/_polynomial.py @@ -2,6 +2,9 @@ This file contains preprocessing tools based on polynomials. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import collections from itertools import chain, combinations from itertools import combinations_with_replacement as combinations_w_r diff --git a/sklearn/preprocessing/_target_encoder.py b/sklearn/preprocessing/_target_encoder.py index b3b7c3d5e7bd9..1855f340c624d 100644 --- a/sklearn/preprocessing/_target_encoder.py +++ b/sklearn/preprocessing/_target_encoder.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from numbers import Integral, Real import numpy as np diff --git a/sklearn/semi_supervised/__init__.py b/sklearn/semi_supervised/__init__.py index 055c3f431b2c1..fba2488a753df 100644 --- a/sklearn/semi_supervised/__init__.py +++ b/sklearn/semi_supervised/__init__.py @@ -4,6 +4,9 @@ data for classification tasks. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._label_propagation import LabelPropagation, LabelSpreading from ._self_training import SelfTrainingClassifier diff --git a/sklearn/semi_supervised/_label_propagation.py b/sklearn/semi_supervised/_label_propagation.py index 9b8f4b8da7b37..ef32313c3c75f 100644 --- a/sklearn/semi_supervised/_label_propagation.py +++ b/sklearn/semi_supervised/_label_propagation.py @@ -54,6 +54,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import warnings from abc import ABCMeta, abstractmethod from numbers import Integral, Real diff --git a/sklearn/svm/_base.py b/sklearn/svm/_base.py index 47d4027c50754..fb61c407e1fb8 100644 --- a/sklearn/svm/_base.py +++ b/sklearn/svm/_base.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings from abc import ABCMeta, abstractmethod from numbers import Integral, Real diff --git a/sklearn/svm/_classes.py b/sklearn/svm/_classes.py index 5b547fcb98cd6..9ce346780a8eb 100644 --- a/sklearn/svm/_classes.py +++ b/sklearn/svm/_classes.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from numbers import Integral, Real import numpy as np diff --git a/sklearn/tree/__init__.py b/sklearn/tree/__init__.py index 23ab17aa0bbbe..c961a811fe05c 100644 --- a/sklearn/tree/__init__.py +++ b/sklearn/tree/__init__.py @@ -1,5 +1,8 @@ """Decision tree based models for classification and regression.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from ._classes import ( BaseDecisionTree, DecisionTreeClassifier, diff --git a/sklearn/tree/_export.py b/sklearn/tree/_export.py index 14b9be332f676..9cb55f7aa1aa4 100644 --- a/sklearn/tree/_export.py +++ b/sklearn/tree/_export.py @@ -4,6 +4,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + from collections.abc import Iterable from io import StringIO from numbers import Integral diff --git a/sklearn/utils/__init__.py b/sklearn/utils/__init__.py index 011347cb2d443..cb06d90572c7e 100644 --- a/sklearn/utils/__init__.py +++ b/sklearn/utils/__init__.py @@ -1,5 +1,8 @@ """Various utilities to help with development.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import platform import warnings from collections.abc import Sequence diff --git a/sklearn/utils/_arpack.py b/sklearn/utils/_arpack.py index 3465ac98c2e81..ba82127f98c43 100644 --- a/sklearn/utils/_arpack.py +++ b/sklearn/utils/_arpack.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from .validation import check_random_state diff --git a/sklearn/utils/_array_api.py b/sklearn/utils/_array_api.py index 2f8e5dddd6868..231d2b3914a0c 100644 --- a/sklearn/utils/_array_api.py +++ b/sklearn/utils/_array_api.py @@ -1,5 +1,8 @@ """Tools to support array_api.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import itertools import math from functools import wraps diff --git a/sklearn/utils/_available_if.py b/sklearn/utils/_available_if.py index 2d9598df9de7e..b0da84189d1f3 100644 --- a/sklearn/utils/_available_if.py +++ b/sklearn/utils/_available_if.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from functools import update_wrapper, wraps from types import MethodType diff --git a/sklearn/utils/_bunch.py b/sklearn/utils/_bunch.py index d90aeb7d93c74..a11e80e366135 100644 --- a/sklearn/utils/_bunch.py +++ b/sklearn/utils/_bunch.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings diff --git a/sklearn/utils/_chunking.py b/sklearn/utils/_chunking.py index 7bf53d0626c85..6cb5bb819cec7 100644 --- a/sklearn/utils/_chunking.py +++ b/sklearn/utils/_chunking.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import warnings from itertools import islice from numbers import Integral diff --git a/sklearn/utils/_encode.py b/sklearn/utils/_encode.py index 3fd4d45f522e6..479b11e0f59a2 100644 --- a/sklearn/utils/_encode.py +++ b/sklearn/utils/_encode.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from collections import Counter from contextlib import suppress from typing import NamedTuple diff --git a/sklearn/utils/_estimator_html_repr.py b/sklearn/utils/_estimator_html_repr.py index 4205ea7c619de..5a9cd4186ffa8 100644 --- a/sklearn/utils/_estimator_html_repr.py +++ b/sklearn/utils/_estimator_html_repr.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import html import itertools from contextlib import closing diff --git a/sklearn/utils/_fast_dict.pxd b/sklearn/utils/_fast_dict.pxd index f9f9bf31db1ee..e37f254661ce6 100644 --- a/sklearn/utils/_fast_dict.pxd +++ b/sklearn/utils/_fast_dict.pxd @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + """ Uses C++ map containers for fast dict-like behavior with keys being integers, and values float. diff --git a/sklearn/utils/_indexing.py b/sklearn/utils/_indexing.py index 11ecdfe0ecbd9..6b4b4779db269 100644 --- a/sklearn/utils/_indexing.py +++ b/sklearn/utils/_indexing.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numbers import sys import warnings diff --git a/sklearn/utils/_joblib.py b/sklearn/utils/_joblib.py index 7638a30e7b5fa..03c10397eea1c 100644 --- a/sklearn/utils/_joblib.py +++ b/sklearn/utils/_joblib.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # TODO(1.7): remove this file import warnings as _warnings diff --git a/sklearn/utils/_mask.py b/sklearn/utils/_mask.py index 0a66dc5a20a81..da21c8e68b72d 100644 --- a/sklearn/utils/_mask.py +++ b/sklearn/utils/_mask.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + from contextlib import suppress import numpy as np diff --git a/sklearn/utils/_missing.py b/sklearn/utils/_missing.py index b48381cfcf3bb..daeb9ba68cc1c 100644 --- a/sklearn/utils/_missing.py +++ b/sklearn/utils/_missing.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import math import numbers from contextlib import suppress diff --git a/sklearn/utils/_mocking.py b/sklearn/utils/_mocking.py index 0afed8c08cfaa..6653a4a17a45e 100644 --- a/sklearn/utils/_mocking.py +++ b/sklearn/utils/_mocking.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from ..base import BaseEstimator, ClassifierMixin diff --git a/sklearn/utils/_optional_dependencies.py b/sklearn/utils/_optional_dependencies.py index 14ffeb1d5b6ee..1de7f4479b242 100644 --- a/sklearn/utils/_optional_dependencies.py +++ b/sklearn/utils/_optional_dependencies.py @@ -1,3 +1,7 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + + def check_matplotlib_support(caller_name): """Raise ImportError with detailed error message if mpl is not installed. diff --git a/sklearn/utils/_param_validation.py b/sklearn/utils/_param_validation.py index 56b7d0ee1fe4c..53c9eeee65af4 100644 --- a/sklearn/utils/_param_validation.py +++ b/sklearn/utils/_param_validation.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import functools import math import operator diff --git a/sklearn/utils/_plotting.py b/sklearn/utils/_plotting.py index 2db38baa9abfa..8d2c7d3bf101b 100644 --- a/sklearn/utils/_plotting.py +++ b/sklearn/utils/_plotting.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from . import check_consistent_length diff --git a/sklearn/utils/_pprint.py b/sklearn/utils/_pprint.py index 5045300357306..98330e8f51abb 100644 --- a/sklearn/utils/_pprint.py +++ b/sklearn/utils/_pprint.py @@ -1,6 +1,9 @@ """This module contains the _EstimatorPrettyPrinter class used in BaseEstimator.__repr__ for pretty-printing estimators""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Python Software Foundation; # All Rights Reserved diff --git a/sklearn/utils/_random.pyx b/sklearn/utils/_random.pyx index 838db540a210d..f0e649e60fe7c 100644 --- a/sklearn/utils/_random.pyx +++ b/sklearn/utils/_random.pyx @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + """ Random utility function ======================= diff --git a/sklearn/utils/_response.py b/sklearn/utils/_response.py index 0381c872a94b0..86c430dbd23f2 100644 --- a/sklearn/utils/_response.py +++ b/sklearn/utils/_response.py @@ -3,6 +3,9 @@ It allows to make uniform checks and validation. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from ..base import is_classifier diff --git a/sklearn/utils/_set_output.py b/sklearn/utils/_set_output.py index 42757dbb00fae..9f1504bd513d9 100644 --- a/sklearn/utils/_set_output.py +++ b/sklearn/utils/_set_output.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import importlib from functools import wraps from typing import Protocol, runtime_checkable diff --git a/sklearn/utils/_show_versions.py b/sklearn/utils/_show_versions.py index a947e35838504..cbdece30db326 100644 --- a/sklearn/utils/_show_versions.py +++ b/sklearn/utils/_show_versions.py @@ -4,6 +4,7 @@ adapted from :func:`pandas.show_versions` """ +# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import platform diff --git a/sklearn/utils/_tags.py b/sklearn/utils/_tags.py index c8f6ffb651a0d..db8473721d2b6 100644 --- a/sklearn/utils/_tags.py +++ b/sklearn/utils/_tags.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np _DEFAULT_TAGS = { diff --git a/sklearn/utils/_testing.py b/sklearn/utils/_testing.py index 961091e4af71a..d75ca9e19cdff 100644 --- a/sklearn/utils/_testing.py +++ b/sklearn/utils/_testing.py @@ -2,6 +2,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import atexit import contextlib import functools diff --git a/sklearn/utils/_user_interface.py b/sklearn/utils/_user_interface.py index 09e6f2b7bf849..8e7550b09be2c 100644 --- a/sklearn/utils/_user_interface.py +++ b/sklearn/utils/_user_interface.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import timeit from contextlib import contextmanager diff --git a/sklearn/utils/deprecation.py b/sklearn/utils/deprecation.py index a3225597701c7..df218029829c1 100644 --- a/sklearn/utils/deprecation.py +++ b/sklearn/utils/deprecation.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import functools import warnings diff --git a/sklearn/utils/discovery.py b/sklearn/utils/discovery.py index 7a6c73997ef8c..40d5b5f8cf714 100644 --- a/sklearn/utils/discovery.py +++ b/sklearn/utils/discovery.py @@ -1,5 +1,8 @@ """Utilities to discover scikit-learn objects.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import inspect import pkgutil from importlib import import_module diff --git a/sklearn/utils/estimator_checks.py b/sklearn/utils/estimator_checks.py index 1eb920f90643a..a8776aa19608e 100644 --- a/sklearn/utils/estimator_checks.py +++ b/sklearn/utils/estimator_checks.py @@ -1,5 +1,8 @@ """Various utilities to check the compatibility of estimators with scikit-learn API.""" +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import pickle import re import warnings diff --git a/sklearn/utils/metaestimators.py b/sklearn/utils/metaestimators.py index 000722e253d14..f962acb48f74e 100644 --- a/sklearn/utils/metaestimators.py +++ b/sklearn/utils/metaestimators.py @@ -2,6 +2,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + from abc import ABCMeta, abstractmethod from contextlib import suppress from typing import Any, List diff --git a/sklearn/utils/optimize.py b/sklearn/utils/optimize.py index 980271a572b9a..fe60136c12d09 100644 --- a/sklearn/utils/optimize.py +++ b/sklearn/utils/optimize.py @@ -9,10 +9,11 @@ significant speedups. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + # This is a modified file from scipy.optimize # Original authors: Travis Oliphant, Eric Jones -# Modifications by Gael Varoquaux, Mathieu Blondel and Tom Dupre la Tour -# SPDX-License-Identifier: BSD-3-Clause import warnings diff --git a/sklearn/utils/parallel.py b/sklearn/utils/parallel.py index 7d7349ebe2816..da7ad69ffc3bf 100644 --- a/sklearn/utils/parallel.py +++ b/sklearn/utils/parallel.py @@ -2,6 +2,9 @@ usage. """ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import functools import warnings from functools import update_wrapper diff --git a/sklearn/utils/random.py b/sklearn/utils/random.py index e7408de304b89..aad8b84828514 100644 --- a/sklearn/utils/random.py +++ b/sklearn/utils/random.py @@ -2,6 +2,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import array import numpy as np diff --git a/sklearn/utils/sparsefuncs.py b/sklearn/utils/sparsefuncs.py index 8e721c6b3852c..fb29de8ad7c6e 100644 --- a/sklearn/utils/sparsefuncs.py +++ b/sklearn/utils/sparsefuncs.py @@ -2,6 +2,7 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import numpy as np import scipy.sparse as sp from scipy.sparse.linalg import LinearOperator diff --git a/sklearn/utils/stats.py b/sklearn/utils/stats.py index d0e22ea3694f4..0fc3fae8a88f0 100644 --- a/sklearn/utils/stats.py +++ b/sklearn/utils/stats.py @@ -1,3 +1,6 @@ +# Authors: The scikit-learn developers +# SPDX-License-Identifier: BSD-3-Clause + import numpy as np from .extmath import stable_cumsum diff --git a/sklearn/utils/tests/test_extmath.py b/sklearn/utils/tests/test_extmath.py index 5b27a52d29ccf..66d3ec74f5490 100644 --- a/sklearn/utils/tests/test_extmath.py +++ b/sklearn/utils/tests/test_extmath.py @@ -1,5 +1,6 @@ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause + import numpy as np import pytest from scipy import linalg, sparse