repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/miscellaneous/plot_estimator_representation.py
examples/miscellaneous/plot_estimator_representation.py
""" =========================================== Displaying estimators and complex pipelines =========================================== This example illustrates different ways estimators and pipelines can be displayed. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.co...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/preprocessing/plot_scaling_importance.py
examples/preprocessing/plot_scaling_importance.py
""" ============================= Importance of Feature Scaling ============================= Feature scaling through standardization, also called Z-score normalization, is an important preprocessing step for many machine learning algorithms. It involves rescaling each feature such that it has a standard deviation of ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/preprocessing/plot_all_scaling.py
examples/preprocessing/plot_all_scaling.py
""" ============================================================= Compare the effect of different scalers on data with outliers ============================================================= Feature 0 (median income in a block) and feature 5 (average house occupancy) of the :ref:`california_housing_dataset` have very d...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/preprocessing/plot_target_encoder.py
examples/preprocessing/plot_target_encoder.py
""" ============================================ Comparing Target Encoder with Other Encoders ============================================ .. currentmodule:: sklearn.preprocessing The :class:`TargetEncoder` uses the value of the target to encode each categorical feature. In this example, we will compare three differe...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/preprocessing/plot_discretization_classification.py
examples/preprocessing/plot_discretization_classification.py
""" ====================== Feature discretization ====================== A demonstration of feature discretization on synthetic classification datasets. Feature discretization decomposes each feature into a set of bins, here equally distributed in width. The discrete values are then one-hot encoded, and given to a lin...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/preprocessing/plot_discretization_strategies.py
examples/preprocessing/plot_discretization_strategies.py
""" ========================================================== Demonstrating the different strategies of KBinsDiscretizer ========================================================== This example presents the different strategies implemented in KBinsDiscretizer: - 'uniform': The discretization is uniform in each featur...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/preprocessing/plot_discretization.py
examples/preprocessing/plot_discretization.py
""" ================================================================ Using KBinsDiscretizer to discretize continuous features ================================================================ The example compares prediction result of linear regression (linear model) and decision tree (tree based model) with and without...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/preprocessing/plot_target_encoder_cross_val.py
examples/preprocessing/plot_target_encoder_cross_val.py
""" ======================================= Target Encoder's Internal Cross fitting ======================================= .. currentmodule:: sklearn.preprocessing The :class:`TargetEncoder` replaces each category of a categorical feature with the shrunk mean of the target variable for that category. This method is ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/preprocessing/plot_map_data_to_normal.py
examples/preprocessing/plot_map_data_to_normal.py
""" ================================= Map data to a normal distribution ================================= .. currentmodule:: sklearn.preprocessing This example demonstrates the use of the Box-Cox and Yeo-Johnson transforms through :class:`~PowerTransformer` to map data from various distributions to a normal distribut...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/classification/plot_classifier_comparison.py
examples/classification/plot_classifier_comparison.py
""" ===================== Classifier comparison ===================== A comparison of several classifiers in scikit-learn on synthetic datasets. The point of this example is to illustrate the nature of decision boundaries of different classifiers. This should be taken with a grain of salt, as the intuition conveyed by...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/classification/plot_digits_classification.py
examples/classification/plot_digits_classification.py
""" ================================ Recognizing hand-written digits ================================ This example shows how scikit-learn can be used to recognize images of hand-written digits, from 0-9. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause # Standard scientific Python ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/classification/plot_classification_probability.py
examples/classification/plot_classification_probability.py
""" =============================== Plot classification probability =============================== This example illustrates the use of :class:`sklearn.inspection.DecisionBoundaryDisplay` to plot the predicted class probabilities of various classifiers in a 2D feature space, mostly for didactic purposes. The first th...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/classification/plot_lda_qda.py
examples/classification/plot_lda_qda.py
""" ==================================================================== Linear and Quadratic Discriminant Analysis with covariance ellipsoid ==================================================================== This example plots the covariance ellipsoids of each class and the decision boundary learned by :class:`~skl...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/classification/plot_lda.py
examples/classification/plot_lda.py
""" =========================================================================== Normal, Ledoit-Wolf and OAS Linear Discriminant Analysis for classification =========================================================================== This example illustrates how the Ledoit-Wolf and Oracle Approximating Shrinkage (OAS) e...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/multioutput/plot_classifier_chain_yeast.py
examples/multioutput/plot_classifier_chain_yeast.py
""" ================================================== Multilabel classification using a classifier chain ================================================== This example shows how to use :class:`~sklearn.multioutput.ClassifierChain` to solve a multilabel classification problem. The most naive strategy to solve such a ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/datasets/plot_random_multilabel_dataset.py
examples/datasets/plot_random_multilabel_dataset.py
""" ============================================== Plot randomly generated multilabel dataset ============================================== This illustrates the :func:`~sklearn.datasets.make_multilabel_classification` dataset generator. Each sample consists of counts of two features (up to 50 in total), which are dif...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_face_recognition.py
examples/applications/plot_face_recognition.py
""" =================================================== Faces recognition example using eigenfaces and SVMs =================================================== The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", aka LFW: https://www.kaggle.com/datasets/jessicali9530/lfw-datas...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_prediction_latency.py
examples/applications/plot_prediction_latency.py
""" ================== Prediction Latency ================== This is an example showing the prediction latency of various scikit-learn estimators. The goal is to measure the latency one can expect when doing predictions either in bulk or atomic (i.e. one by one) mode. The plots represent the distribution of the pred...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_cyclical_feature_engineering.py
examples/applications/plot_cyclical_feature_engineering.py
""" ================================ Time-related feature engineering ================================ This notebook introduces different strategies to leverage time-related features for a bike sharing demand regression task that is highly dependent on business cycles (days, weeks, months) and yearly season cycles. I...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/wikipedia_principal_eigenvector.py
examples/applications/wikipedia_principal_eigenvector.py
""" =============================== Wikipedia principal eigenvector =============================== A classical way to assert the relative importance of vertices in a graph is to compute the principal eigenvector of the adjacency matrix so as to assign to each vertex the values of the components of the first eigenvect...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_model_complexity_influence.py
examples/applications/plot_model_complexity_influence.py
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. We will be using two datasets: - :ref:`diabetes_dataset` for regression. This dataset consists of 10 measurements taken fro...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_time_series_lagged_features.py
examples/applications/plot_time_series_lagged_features.py
""" =========================================== Lagged features for time series forecasting =========================================== This example demonstrates how Polars-engineered lagged features can be used for time series forecasting with :class:`~sklearn.ensemble.HistGradientBoostingRegressor` on the Bike Shari...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_outlier_detection_wine.py
examples/applications/plot_outlier_detection_wine.py
""" ==================================== Outlier detection on a real data set ==================================== This example illustrates the need for robust covariance estimation on a real data set. It is useful both for outlier detection and for a better understanding of the data structure. We selected two sets o...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_tomography_l1_reconstruction.py
examples/applications/plot_tomography_l1_reconstruction.py
""" ====================================================================== Compressive sensing: tomography reconstruction with L1 prior (Lasso) ====================================================================== This example shows the reconstruction of an image from a set of parallel projections, acquired along dif...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_out_of_core_classification.py
examples/applications/plot_out_of_core_classification.py
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_topics_extraction_with_nmf_lda.py
examples/applications/plot_topics_extraction_with_nmf_lda.py
""" ======================================================================================= Topic extraction with Non-negative Matrix Factorization and Latent Dirichlet Allocation ======================================================================================= This is an example of applying :class:`~sklearn.dec...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_species_distribution_modeling.py
examples/applications/plot_species_distribution_modeling.py
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example, we model the geographic distribution of two South American mammals given past observations and 14 environmental vari...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_digits_denoising.py
examples/applications/plot_digits_denoising.py
""" ================================ Image denoising using kernel PCA ================================ This example shows how to use :class:`~sklearn.decomposition.KernelPCA` to denoise images. In short, we take advantage of the approximation function learned during `fit` to reconstruct the original image. We will co...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/applications/plot_stock_market.py
examples/applications/plot_stock_market.py
""" ======================================= Visualizing the stock market structure ======================================= This example employs several unsupervised learning techniques to extract the stock market structure from variations in historical quotes. The quantity that we use is the daily variation in quote ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/semi_supervised/plot_self_training_varying_threshold.py
examples/semi_supervised/plot_self_training_varying_threshold.py
""" ============================================= Effect of varying threshold for self-training ============================================= This example illustrates the effect of a varying threshold on self-training. The `breast_cancer` dataset is loaded, and labels are deleted such that only 50 out of 569 samples h...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/semi_supervised/plot_semi_supervised_versus_svm_iris.py
examples/semi_supervised/plot_semi_supervised_versus_svm_iris.py
""" =============================================================================== Decision boundary of semi-supervised classifiers versus SVM on the Iris dataset =============================================================================== This example compares decision boundaries learned by two semi-supervised me...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/semi_supervised/plot_label_propagation_digits_active_learning.py
examples/semi_supervised/plot_label_propagation_digits_active_learning.py
""" ========================================= Label Propagation digits: Active learning ========================================= Demonstrates an active learning technique to learn handwritten digits using label propagation. We start by training a label propagation model with only 10 labeled points, then we select th...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/semi_supervised/plot_semi_supervised_newsgroups.py
examples/semi_supervised/plot_semi_supervised_newsgroups.py
""" ================================================ Semi-supervised Classification on a Text Dataset ================================================ This example demonstrates the effectiveness of semi-supervised learning for text classification on :class:`TF-IDF <sklearn.feature_extraction.text.TfidfTransformer>` fe...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/semi_supervised/plot_label_propagation_digits.py
examples/semi_supervised/plot_label_propagation_digits.py
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/semi_supervised/plot_label_propagation_structure.py
examples/semi_supervised/plot_label_propagation_structure.py
""" ======================================================= Label Propagation circles: Learning a complex structure ======================================================= Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cross_decomposition/plot_pcr_vs_pls.py
examples/cross_decomposition/plot_pcr_vs_pls.py
""" ================================================================== Principal Component Regression vs Partial Least Squares Regression ================================================================== This example compares `Principal Component Regression <https://en.wikipedia.org/wiki/Principal_component_regressio...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cross_decomposition/plot_compare_cross_decomposition.py
examples/cross_decomposition/plot_compare_cross_decomposition.py
""" =================================== Compare cross decomposition methods =================================== Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with multivariate response, a.k.a. PLS2 - PLSRegression, with univariate response, a.k.a. PLS1 - CCA Given 2 multivar...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_lasso_lasso_lars_elasticnet_path.py
examples/linear_model/plot_lasso_lasso_lars_elasticnet_path.py
""" ======================================== Lasso, Lasso-LARS, and Elastic Net paths ======================================== This example shows how to compute the "paths" of coefficients along the Lasso, Lasso-LARS, and Elastic Net regularization paths. In other words, it shows the relationship between the regulariz...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_omp.py
examples/linear_model/plot_omp.py
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as p...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sgd_iris.py
examples/linear_model/plot_sgd_iris.py
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ # Authors: The ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sparse_logistic_regression_mnist.py
examples/linear_model/plot_sparse_logistic_regression_mnist.py
""" ===================================================== MNIST classification using multinomial logistic + L1 ===================================================== Here we fit a multinomial logistic regression with L1 penalty on a subset of the MNIST digits classification task. We use the SAGA algorithm for this purp...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_lasso_dense_vs_sparse_data.py
examples/linear_model/plot_lasso_dense_vs_sparse_data.py
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-C...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_lasso_model_selection.py
examples/linear_model/plot_lasso_model_selection.py
""" ================================================= Lasso model selection: AIC-BIC / cross-validation ================================================= This example focuses on model selection for Lasso models that are linear models with an L1 penalty for regression problems. Indeed, several strategies can be used t...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_polynomial_interpolation.py
examples/linear_model/plot_polynomial_interpolation.py
""" =================================== Polynomial and Spline interpolation =================================== This example demonstrates how to approximate a function with polynomials up to degree ``degree`` by using ridge regression. We show two different ways given ``n_samples`` of 1d points ``x_i``: - :class:`~sk...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_bayesian_ridge_curvefit.py
examples/linear_model/plot_bayesian_ridge_curvefit.py
""" ============================================ Curve Fitting with Bayesian Ridge Regression ============================================ Computes a Bayesian Ridge Regression of Sinusoids. See :ref:`bayesian_ridge_regression` for more information on the regressor. In general, when fitting a curve with a polynomial ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sgd_early_stopping.py
examples/linear_model/plot_sgd_early_stopping.py
""" ============================================= Early stopping of Stochastic Gradient Descent ============================================= Stochastic Gradient Descent is an optimization technique which minimizes a loss function in a stochastic fashion, performing a gradient descent step sample by sample. In particu...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_poisson_regression_non_normal_loss.py
examples/linear_model/plot_poisson_regression_non_normal_loss.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause """ ====================================== Poisson regression and non-normal loss ====================================== This example illustrates the use of log-linear Poisson regression on the `French Motor Third-Party Liability Claims da...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_ridge_path.py
examples/linear_model/plot_ridge_path.py
""" =========================================================== Plot Ridge coefficients as a function of the regularization =========================================================== Shows the effect of collinearity in the coefficients of an estimator. .. currentmodule:: sklearn.linear_model :class:`Ridge` Regressi...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sparse_logistic_regression_20newsgroups.py
examples/linear_model/plot_sparse_logistic_regression_20newsgroups.py
""" ==================================================== Multiclass sparse logistic regression on 20newgroups ==================================================== Comparison of multinomial logistic L1 vs one-versus-rest L1 logistic regression to classify documents from the newgroups20 dataset. Multinomial logistic reg...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_robust_fit.py
examples/linear_model/plot_robust_fit.py
""" Robust linear estimator fitting =============================== Here a sine function is fit with a polynomial of order 3, for values close to zero. Robust fitting is demonstrated in different situations: - No measurement errors, only modelling errors (fitting a sine with a polynomial) - Measurement errors in ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_logistic_multinomial.py
examples/linear_model/plot_logistic_multinomial.py
""" ====================================================================== Decision Boundaries of Multinomial and One-vs-Rest Logistic Regression ====================================================================== This example compares decision boundaries of multinomial and one-vs-rest logistic regression on a 2D d...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
""" ========================================================================== Fitting an Elastic Net with a precomputed Gram Matrix and Weighted Samples ========================================================================== The following example shows how to precompute the gram matrix while using weighted samples...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_lasso_and_elasticnet.py
examples/linear_model/plot_lasso_and_elasticnet.py
""" ================================== L1-based models for Sparse Signals ================================== The present example compares three l1-based regression models on a synthetic signal obtained from sparse and correlated features that are further corrupted with additive Gaussian noise: - a :ref:`lasso`; - an ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sgd_weighted_samples.py
examples/linear_model/plot_sgd_weighted_samples.py
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt import numpy as np from skle...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_ridge_coeffs.py
examples/linear_model/plot_ridge_coeffs.py
""" ========================================================= Ridge coefficients as a function of the L2 Regularization ========================================================= A model that overfits learns the training data too well, capturing both the underlying patterns and the noise in the data. However, when appl...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_ransac.py
examples/linear_model/plot_ransac.py
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example, we see how to robustly fit a linear model to faulty data using the :ref:`RANSAC <ransac_regression>` algorithm. The ordinary linear regressor is sensitive to outlier...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sgdocsvm_vs_ocsvm.py
examples/linear_model/plot_sgdocsvm_vs_ocsvm.py
""" ==================================================================== One-Class SVM versus One-Class SVM using Stochastic Gradient Descent ==================================================================== This example shows how to approximate the solution of :class:`sklearn.svm.OneClassSVM` in the case of an RBF...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_nnls.py
examples/linear_model/plot_nnls.py
""" ========================== Non-negative least squares ========================== In this example, we fit a linear model with positive constraints on the regression coefficients and compare the estimated coefficients to a classic linear regression. """ # Authors: The scikit-learn developers # SPDX-License-Identif...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_theilsen.py
examples/linear_model/plot_theilsen.py
""" ==================== Theil-Sen Regression ==================== Computes a Theil-Sen Regression on a synthetic dataset. See :ref:`theil_sen_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the Theil-Sen estimator is robust against outliers. It has a breakd...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_lasso_lars_ic.py
examples/linear_model/plot_lasso_lars_ic.py
""" ============================================== Lasso model selection via information criteria ============================================== This example reproduces the example of Fig. 2 of [ZHT2007]_. A :class:`~sklearn.linear_model.LassoLarsIC` estimator is fit on a diabetes dataset and the AIC and the BIC crite...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_tweedie_regression_insurance_claims.py
examples/linear_model/plot_tweedie_regression_insurance_claims.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause """ ====================================== Tweedie regression on insurance claims ====================================== This example illustrates the use of Poisson, Gamma and Tweedie regression on the `French Motor Third-Party Liability C...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sgd_separating_hyperplane.py
examples/linear_model/plot_sgd_separating_hyperplane.py
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ # Authors: The scikit-learn dev...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_logistic_path.py
examples/linear_model/plot_logistic_path.py
""" ============================================== Regularization path of L1- Logistic Regression ============================================== Train l1-penalized logistic regression models on a binary classification problem derived from the Iris dataset. The models are ordered from strongest regularized to least r...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_quantile_regression.py
examples/linear_model/plot_quantile_regression.py
""" =================== Quantile regression =================== This example illustrates how quantile regression can predict non-trivial conditional quantiles. The left figure shows the case when the error distribution is normal, but has non-constant variance, i.e. with heteroscedasticity. The right figure shows an ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_multi_task_lasso_support.py
examples/linear_model/plot_multi_task_lasso_support.py
""" ============================================= Joint feature selection with multi-task Lasso ============================================= The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected features to be the same across tasks. This example simulates sequential measuremen...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_ard.py
examples/linear_model/plot_ard.py
""" ==================================== Comparing Linear Bayesian Regressors ==================================== This example compares two different bayesian regressors: - an :ref:`automatic_relevance_determination` - a :ref:`bayesian_ridge_regression` In the first part, we use an :ref:`ordinary_least_squares` (OL...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_huber_vs_ridge.py
examples/linear_model/plot_huber_vs_ridge.py
""" ======================================================= HuberRegressor vs Ridge on dataset with strong outliers ======================================================= Fit Ridge and HuberRegressor on a dataset with outliers. The example shows that the predictions in ridge are strongly influenced by the outliers p...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_logistic_l1_l2_sparsity.py
examples/linear_model/plot_logistic_l1_l2_sparsity.py
""" ============================================== L1 Penalty and Sparsity in Logistic Regression ============================================== Comparison of the sparsity (percentage of zero coefficients) of solutions when L1, L2 and Elastic-Net penalty are used for different values of C. We can see that large values...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sgd_penalties.py
examples/linear_model/plot_sgd_penalties.py
""" ============== SGD: Penalties ============== Contours of where the penalty is equal to 1 for the three penalties L1, L2 and elastic-net. All of the above are supported by :class:`~sklearn.linear_model.SGDClassifier` and :class:`~sklearn.linear_model.SGDRegressor`. """ # Authors: The scikit-learn developers # SP...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_ols_ridge.py
examples/linear_model/plot_ols_ridge.py
""" =========================================== Ordinary Least Squares and Ridge Regression =========================================== 1. Ordinary Least Squares: We illustrate how to use the ordinary least squares (OLS) model, :class:`~sklearn.linear_model.LinearRegression`, on a single feature of the diabet...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/linear_model/plot_sgd_loss_functions.py
examples/linear_model/plot_sgd_loss_functions.py
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`~sklearn.linear_model.SGDClassifier` . """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import matplotlib.pyplot as plt i...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/compose/plot_column_transformer.py
examples/compose/plot_column_transformer.py
""" ================================================== Column Transformer with Heterogeneous Data Sources ================================================== Datasets can often contain components that require different feature extraction and processing pipelines. This scenario might occur when: 1. your dataset consist...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/compose/plot_compare_reduction.py
examples/compose/plot_compare_reduction.py
""" ================================================================= Selecting dimensionality reduction with Pipeline and GridSearchCV ================================================================= This example constructs a pipeline that does dimensionality reduction followed by prediction with a support vector cl...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/compose/plot_feature_union.py
examples/compose/plot_feature_union.py
""" ================================================= Concatenating multiple feature extraction methods ================================================= In many real-world examples, there are many ways to extract features from a dataset. Often it is beneficial to combine several methods to obtain good performance. Th...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/compose/plot_transformed_target.py
examples/compose/plot_transformed_target.py
""" ====================================================== Effect of transforming the targets in regression model ====================================================== In this example, we give an overview of :class:`~sklearn.compose.TransformedTargetRegressor`. We use two examples to illustrate the benefit of transfo...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/compose/plot_digits_pipe.py
examples/compose/plot_digits_pipe.py
""" ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the prediction. We use a GridSearchCV to set the dimens...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/compose/plot_column_transformer_mixed_types.py
examples/compose/plot_column_transformer_mixed_types.py
""" =================================== Column Transformer with Mixed Types =================================== .. currentmodule:: sklearn This example illustrates how to apply different preprocessing and feature extraction pipelines to different subsets of features, using :class:`~compose.ColumnTransformer`. This is...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/inspection/plot_permutation_importance_multicollinear.py
examples/inspection/plot_permutation_importance_multicollinear.py
""" ================================================================= Permutation Importance with Multicollinear or Correlated Features ================================================================= In this example, we compute the :func:`~sklearn.inspection.permutation_importance` of the features to a trained :clas...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/inspection/plot_linear_model_coefficient_interpretation.py
examples/inspection/plot_linear_model_coefficient_interpretation.py
""" ====================================================================== Common pitfalls in the interpretation of coefficients of linear models ====================================================================== In linear models, the target value is modeled as a linear combination of the features (see the :ref:`l...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/inspection/plot_partial_dependence.py
examples/inspection/plot_partial_dependence.py
""" =============================================================== Partial Dependence and Individual Conditional Expectation Plots =============================================================== Partial dependence plots show the dependence between the target function [2]_ and a set of features of interest, marginaliz...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/inspection/plot_permutation_importance.py
examples/inspection/plot_permutation_importance.py
""" ================================================================ Permutation Importance vs Random Forest Feature Importance (MDI) ================================================================ In this example, we will compare the impurity-based feature importance of :class:`~sklearn.ensemble.RandomForestClassifi...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/inspection/plot_causal_interpretation.py
examples/inspection/plot_causal_interpretation.py
""" =================================================== Failure of Machine Learning to infer causal effects =================================================== Machine Learning models are great for measuring statistical associations. Unfortunately, unless we're willing to make strong assumptions about the data, those ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_coin_ward_segmentation.py
examples/cluster/plot_coin_ward_segmentation.py
""" ====================================================================== A demo of structured Ward hierarchical clustering on an image of coins ====================================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_digits_agglomeration.py
examples/cluster/plot_digits_agglomeration.py
""" ========================================================= Feature agglomeration ========================================================= These images show how similar features are merged together using feature agglomeration. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause imp...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_bisect_kmeans.py
examples/cluster/plot_bisect_kmeans.py
""" ============================================================= Bisecting K-Means and Regular K-Means Performance Comparison ============================================================= This example shows differences between Regular K-Means algorithm and Bisecting K-Means. While K-Means clusterings are different w...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_agglomerative_dendrogram.py
examples/cluster/plot_agglomerative_dendrogram.py
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause """ ========================================= Plot Hierarchical Clustering Dendrogram ========================================= This example plots the corresponding dendrogram of a hierarchical clustering using AgglomerativeClustering and t...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_kmeans_silhouette_analysis.py
examples/cluster/plot_kmeans_silhouette_analysis.py
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_linkage_comparison.py
examples/cluster/plot_linkage_comparison.py
""" ================================================================ Comparing different hierarchical linkage methods on toy datasets ================================================================ This example shows characteristics of different linkage methods for hierarchical clustering on datasets that are "intere...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_segmentation_toy.py
examples/cluster/plot_segmentation_toy.py
""" =========================================== Spectral clustering for image segmentation =========================================== In this example, an image with connected circles is generated and spectral clustering is used to separate the circles. In these settings, the :ref:`spectral_clustering` approach solve...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_ward_structured_vs_unstructured.py
examples/cluster/plot_ward_structured_vs_unstructured.py
""" =================================================== Hierarchical clustering with and without structure =================================================== This example demonstrates hierarchical clustering with and without connectivity constraints. It shows the effect of imposing a connectivity graph to capture loc...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_digits_linkage.py
examples/cluster/plot_digits_linkage.py
""" ============================================================================= Various Agglomerative Clustering on a 2D embedding of digits ============================================================================= An illustration of various linkage option for agglomerative clustering on a 2D embedding of the di...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_hdbscan.py
examples/cluster/plot_hdbscan.py
# -*- coding: utf-8 -*- """ ==================================== Demo of HDBSCAN clustering algorithm ==================================== .. currentmodule:: sklearn In this demo we will take a look at :class:`cluster.HDBSCAN` from the perspective of generalizing the :class:`cluster.DBSCAN` algorithm. We'll compare bo...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_mean_shift.py
examples/cluster/plot_mean_shift.py
""" ============================================= A demo of the mean-shift clustering algorithm ============================================= Reference: Dorin Comaniciu and Peter Meer, "Mean Shift: A robust approach toward feature space analysis". IEEE Transactions on Pattern Analysis and Machine Intelligence. 2002. ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_dict_face_patches.py
examples/cluster/plot_dict_face_patches.py
""" Online learning of a dictionary of parts of faces ================================================= This example uses a large dataset of faces to learn a set of 20 x 20 images patches that constitute faces. From the programming standpoint, it is interesting because it shows how to use the online API of the scikit...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_optics.py
examples/cluster/plot_optics.py
""" =================================== Demo of OPTICS clustering algorithm =================================== .. currentmodule:: sklearn Finds core samples of high density and expands clusters from them. This example uses data that is generated so that the clusters have different densities. The :class:`~cluster.OP...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_inductive_clustering.py
examples/cluster/plot_inductive_clustering.py
""" ==================== Inductive Clustering ==================== Clustering can be expensive, especially when our dataset contains millions of datapoints. Many clustering algorithms are not :term:`inductive` and so cannot be directly applied to new data samples without recomputing the clustering, which may be intrac...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_kmeans_plusplus.py
examples/cluster/plot_kmeans_plusplus.py
""" =========================================================== An example of K-Means++ initialization =========================================================== An example to show the output of the :func:`sklearn.cluster.kmeans_plusplus` function for generating initial seeds for clustering. K-Means++ is used as the...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_kmeans_stability_low_dim_dense.py
examples/cluster/plot_kmeans_stability_low_dim_dense.py
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust, as measured by the relative sta...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_mini_batch_kmeans.py
examples/cluster/plot_mini_batch_kmeans.py
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false
scikit-learn/scikit-learn
https://github.com/scikit-learn/scikit-learn/blob/6dce55ebff962076625db46ab70b6b1c939f423b/examples/cluster/plot_affinity_propagation.py
examples/cluster/plot_affinity_propagation.py
""" ================================================= Demo of affinity propagation clustering algorithm ================================================= Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Points", Science Feb. 2007 """ # Authors: The scikit-learn developers # ...
python
BSD-3-Clause
6dce55ebff962076625db46ab70b6b1c939f423b
2026-01-04T14:38:25.175347Z
false