:orphan:

.. _general_examples:

Examples
========

Miscellaneous examples
----------------------

Miscellaneous and introductory examples for scikit-learn.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An illustration of the isotonic regression on generated data. The isotonic regression finds a n...">

.. only:: html

    .. figure:: /auto_examples/images/thumb/sphx_glr_plot_isotonic_regression_thumb.png

        :ref:`sphx_glr_auto_examples_plot_isotonic_regression.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_isotonic_regression

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows the use of multi-output estimator to complete images. The goal is to predict...">

.. only:: html

    .. figure:: /auto_examples/images/thumb/sphx_glr_plot_multioutput_face_completion_thumb.png

        :ref:`sphx_glr_auto_examples_plot_multioutput_face_completion.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_multioutput_face_completion

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example simulates a multi-label document classification problem. The dataset is generated ...">

.. only:: html

    .. figure:: /auto_examples/images/thumb/sphx_glr_plot_multilabel_thumb.png

        :ref:`sphx_glr_auto_examples_plot_multilabel.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_multilabel

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows characteristics of different anomaly detection algorithms on 2D datasets. Da...">

.. only:: html

    .. figure:: /auto_examples/images/thumb/sphx_glr_plot_anomaly_comparison_thumb.png

        :ref:`sphx_glr_auto_examples_plot_anomaly_comparison.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_anomaly_comparison

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip=" The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly pr...">

.. only:: html

    .. figure:: /auto_examples/images/thumb/sphx_glr_plot_johnson_lindenstrauss_bound_thumb.png

        :ref:`sphx_glr_auto_examples_plot_johnson_lindenstrauss_bound.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_johnson_lindenstrauss_bound

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Missing values can be replaced by the mean, the median or the most frequent value using the bas...">

.. only:: html

    .. figure:: /auto_examples/images/thumb/sphx_glr_plot_missing_values_thumb.png

        :ref:`sphx_glr_auto_examples_plot_missing_values.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_missing_values

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Both kernel ridge regression (KRR) and SVR learn a non-linear function by employing the kernel ...">

.. only:: html

    .. figure:: /auto_examples/images/thumb/sphx_glr_plot_kernel_ridge_regression_thumb.png

        :ref:`sphx_glr_auto_examples_plot_kernel_ridge_regression.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_kernel_ridge_regression

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example illustrating the approximation of the feature map of an RBF kernel.">

.. only:: html

    .. figure:: /auto_examples/images/thumb/sphx_glr_plot_kernel_approximation_thumb.png

        :ref:`sphx_glr_auto_examples_plot_kernel_approximation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_kernel_approximation
.. raw:: html

    <div style='clear:both'></div>

.. _realworld_examples:

Examples based on real world datasets
-------------------------------------

Applications to real world problems with some medium sized datasets or
interactive user interface.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the need for robust covariance estimation on a real data set. It is us...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_outlier_detection_housing_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_outlier_detection_housing.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_outlier_detection_housing

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows the reconstruction of an image from a set of parallel projections, acquired ...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_tomography_l1_reconstruction_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_tomography_l1_reconstruction.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_tomography_l1_reconstruction

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example of applying :class:`sklearn.decomposition.NMF` and :class:`sklearn.decomposi...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_topics_extraction_with_nmf_lda_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_topics_extraction_with_nmf_lda.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_topics_extraction_with_nmf_lda

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The dataset used in this example is a preprocessed excerpt of the &quot;Labeled Faces in the Wild&quot;, ...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_face_recognition_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_face_recognition.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_face_recognition

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate how model complexity influences both prediction accuracy and computational performa...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_model_complexity_influence_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_model_complexity_influence.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_model_complexity_influence

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Modeling species&#x27; geographic distributions is an important problem in conservation biology. In ...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_species_distribution_modeling_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_species_distribution_modeling.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_species_distribution_modeling

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example employs several unsupervised learning techniques to extract the stock market struc...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_stock_market_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_stock_market.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_stock_market

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A classical way to assert the relative importance of vertices in a graph is to compute the prin...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_wikipedia_principal_eigenvector_thumb.png

        :ref:`sphx_glr_auto_examples_applications_wikipedia_principal_eigenvector.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/wikipedia_principal_eigenvector

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create da...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_svm_gui_thumb.png

        :ref:`sphx_glr_auto_examples_applications_svm_gui.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/svm_gui

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example showing the prediction latency of various scikit-learn estimators.">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_prediction_latency_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_prediction_latency.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_prediction_latency

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example showing how scikit-learn can be used for classification using an out-of-core...">

.. only:: html

    .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_out_of_core_classification_thumb.png

        :ref:`sphx_glr_auto_examples_applications_plot_out_of_core_classification.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/applications/plot_out_of_core_classification
.. raw:: html

    <div style='clear:both'></div>

.. _bicluster_examples:

Biclustering
------------

Examples concerning the :mod:`sklearn.cluster.bicluster` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to generate a dataset and bicluster it using the Spectral Co-Clus...">

.. only:: html

    .. figure:: /auto_examples/bicluster/images/thumb/sphx_glr_plot_spectral_coclustering_thumb.png

        :ref:`sphx_glr_auto_examples_bicluster_plot_spectral_coclustering.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/bicluster/plot_spectral_coclustering

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spe...">

.. only:: html

    .. figure:: /auto_examples/bicluster/images/thumb/sphx_glr_plot_spectral_biclustering_thumb.png

        :ref:`sphx_glr_auto_examples_bicluster_plot_spectral_biclustering.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/bicluster/plot_spectral_biclustering

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset...">

.. only:: html

    .. figure:: /auto_examples/bicluster/images/thumb/sphx_glr_plot_bicluster_newsgroups_thumb.png

        :ref:`sphx_glr_auto_examples_bicluster_plot_bicluster_newsgroups.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/bicluster/plot_bicluster_newsgroups
.. raw:: html

    <div style='clear:both'></div>

.. _calibration_examples:

Calibration
-----------------------

Examples illustrating the calibration of predicted probabilities of classifiers.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Well calibrated classifiers are probabilistic classifiers for which the output of the predict_p...">

.. only:: html

    .. figure:: /auto_examples/calibration/images/thumb/sphx_glr_plot_compare_calibration_thumb.png

        :ref:`sphx_glr_auto_examples_calibration_plot_compare_calibration.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/calibration/plot_compare_calibration

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When performing classification one often wants to predict not only the class label, but also th...">

.. only:: html

    .. figure:: /auto_examples/calibration/images/thumb/sphx_glr_plot_calibration_curve_thumb.png

        :ref:`sphx_glr_auto_examples_calibration_plot_calibration_curve.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/calibration/plot_calibration_curve

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When performing classification you often want to predict not only the class label, but also the...">

.. only:: html

    .. figure:: /auto_examples/calibration/images/thumb/sphx_glr_plot_calibration_thumb.png

        :ref:`sphx_glr_auto_examples_calibration_plot_calibration.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/calibration/plot_calibration

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates how sigmoid calibration changes predicted probabilities for a 3-class ...">

.. only:: html

    .. figure:: /auto_examples/calibration/images/thumb/sphx_glr_plot_calibration_multiclass_thumb.png

        :ref:`sphx_glr_auto_examples_calibration_plot_calibration_multiclass.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/calibration/plot_calibration_multiclass
.. raw:: html

    <div style='clear:both'></div>

.. _classification_examples:

Classification
-----------------------

General examples about classification algorithms.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example showing how the scikit-learn can be used to recognize images of hand-written digits.">

.. only:: html

    .. figure:: /auto_examples/classification/images/thumb/sphx_glr_plot_digits_classification_thumb.png

        :ref:`sphx_glr_auto_examples_classification_plot_digits_classification.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/classification/plot_digits_classification

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Shows how shrinkage improves classification. ">

.. only:: html

    .. figure:: /auto_examples/classification/images/thumb/sphx_glr_plot_lda_thumb.png

        :ref:`sphx_glr_auto_examples_classification_plot_lda.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/classification/plot_lda

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the classification probability for different classifiers. We use a 3 class dataset, and we...">

.. only:: html

    .. figure:: /auto_examples/classification/images/thumb/sphx_glr_plot_classification_probability_thumb.png

        :ref:`sphx_glr_auto_examples_classification_plot_classification_probability.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/classification/plot_classification_probability

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A comparison of a several classifiers in scikit-learn on synthetic datasets. The point of this ...">

.. only:: html

    .. figure:: /auto_examples/classification/images/thumb/sphx_glr_plot_classifier_comparison_thumb.png

        :ref:`sphx_glr_auto_examples_classification_plot_classifier_comparison.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/classification/plot_classifier_comparison

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example plots the covariance ellipsoids of each class and decision boundary learned by LDA...">

.. only:: html

    .. figure:: /auto_examples/classification/images/thumb/sphx_glr_plot_lda_qda_thumb.png

        :ref:`sphx_glr_auto_examples_classification_plot_lda_qda.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/classification/plot_lda_qda
.. raw:: html

    <div style='clear:both'></div>

.. _cluster_examples:

Clustering
----------

Examples concerning the :mod:`sklearn.cluster` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="These images how similar features are merged together using feature agglomeration. ">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_digits_agglomeration_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_digits_agglomeration.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_digits_agglomeration

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Reference:">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_mean_shift_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_mean_shift.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_mean_shift

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example is meant to illustrate situations where k-means will produce unintuitive and possi...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_kmeans_assumptions_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_kmeans_assumptions.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_kmeans_assumptions

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example uses a large dataset of faces to learn a set of 20 x 20 images patches that consti...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_dict_face_patches_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_dict_face_patches.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_dict_face_patches

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Face, a 1024 x 768 size image of a raccoon face, is used here to illustrate how `k`-means is us...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_face_compress_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_face_compress.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_face_compress

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference ...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_coin_segmentation_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_coin_segmentation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_coin_segmentation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spa...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_coin_ward_segmentation_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_coin_ward_segmentation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_coin_ward_segmentation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows the effect of imposing a connectivity graph to capture local structure in th...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_agglomerative_clustering_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_agglomerative_clustering.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_agglomerative_clustering

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Reference: Brendan J. Frey and Delbert Dueck, &quot;Clustering by Passing Messages Between Data Poin...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_affinity_propagation_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_affinity_propagation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_affinity_propagation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The plots display firstly what a K-means algorithm would yield using three clusters. It is then...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_cluster_iris_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_cluster_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_cluster_iris

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An illustration of various linkage option for agglomerative clustering on a 2D embedding of the...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_digits_linkage_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_digits_linkage.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_digits_linkage

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, an image with connected circles is generated and spectral clustering is used t...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_segmentation_toy_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_segmentation_toy.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_segmentation_toy

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Finds core samples of high density and expands clusters from them.">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_dbscan_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_dbscan.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_dbscan

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reduci...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_color_quantization_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_color_quantization.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_color_quantization

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example builds a swiss roll dataset and runs hierarchical clustering on their position.">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_ward_structured_vs_unstructured_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_ward_structured_vs_unstructured.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_ward_structured_vs_unstructured

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates the effect of different metrics on the hierarchical clustering.">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_agglomerative_clustering_metrics_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_agglomerative_clustering_metrics.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_agglomerative_clustering_metrics

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example compares the timing of Birch (with and without the global clustering step) and Min...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_birch_vs_minibatchkmeans_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_birch_vs_minibatchkmeans.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_birch_vs_minibatchkmeans

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Evaluate the ability of k-means initializations strategies to make the algorithm convergence ro...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_kmeans_stability_low_dim_dense_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_kmeans_stability_low_dim_dense.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_kmeans_stability_low_dim_dense

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The following plots demonstrate the impact of the number of clusters and number of samples on v...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_adjusted_for_chance_measures_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_adjusted_for_chance_measures.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_adjusted_for_chance_measures

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example we compare the various initialization strategies for K-means in terms of runtim...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_kmeans_digits_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_kmeans_digits.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_kmeans_digits

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example compares 2 dimensionality reduction strategies:">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_feature_agglomeration_vs_univariate_selection_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_feature_agglomeration_vs_univariate_selection.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_feature_agglomeration_vs_univariate_selection

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is fa...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_mini_batch_kmeans_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_mini_batch_kmeans.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_mini_batch_kmeans

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows characteristics of different linkage methods for hierarchical clustering on ...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_linkage_comparison_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_linkage_comparison.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_linkage_comparison

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Silhouette analysis can be used to study the separation distance between the resulting clusters...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_kmeans_silhouette_analysis_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_kmeans_silhouette_analysis.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_kmeans_silhouette_analysis

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows characteristics of different clustering algorithms on datasets that are &quot;int...">

.. only:: html

    .. figure:: /auto_examples/cluster/images/thumb/sphx_glr_plot_cluster_comparison_thumb.png

        :ref:`sphx_glr_auto_examples_cluster_plot_cluster_comparison.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cluster/plot_cluster_comparison
.. raw:: html

    <div style='clear:both'></div>

.. _compose_examples:

Pipelines and composite estimators
----------------------------------

Examples of how to compose transformers and pipelines from other estimators. See the :ref:`User Guide <combining_estimators>`.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The PCA does an unsupervised dimensionality reduction, while the logistic regression does the p...">

.. only:: html

    .. figure:: /auto_examples/compose/images/thumb/sphx_glr_plot_digits_pipe_thumb.png

        :ref:`sphx_glr_auto_examples_compose_plot_digits_pipe.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/compose/plot_digits_pipe

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In many real-world examples, there are many ways to extract features from a dataset. Often it i...">

.. only:: html

    .. figure:: /auto_examples/compose/images/thumb/sphx_glr_plot_feature_union_thumb.png

        :ref:`sphx_glr_auto_examples_compose_plot_feature_union.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/compose/plot_feature_union

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates how to apply different preprocessing and feature extraction pipelines ...">

.. only:: html

    .. figure:: /auto_examples/compose/images/thumb/sphx_glr_plot_column_transformer_mixed_types_thumb.png

        :ref:`sphx_glr_auto_examples_compose_plot_column_transformer_mixed_types.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/compose/plot_column_transformer_mixed_types

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example constructs a pipeline that does dimensionality reduction followed by prediction wi...">

.. only:: html

    .. figure:: /auto_examples/compose/images/thumb/sphx_glr_plot_compare_reduction_thumb.png

        :ref:`sphx_glr_auto_examples_compose_plot_compare_reduction.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/compose/plot_compare_reduction

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Datasets can often contain components of that require different feature extraction and processi...">

.. only:: html

    .. figure:: /auto_examples/compose/images/thumb/sphx_glr_plot_column_transformer_thumb.png

        :ref:`sphx_glr_auto_examples_compose_plot_column_transformer.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/compose/plot_column_transformer

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, we give an overview of the :class:`sklearn.compose.TransformedTargetRegressor`...">

.. only:: html

    .. figure:: /auto_examples/compose/images/thumb/sphx_glr_plot_transformed_target_thumb.png

        :ref:`sphx_glr_auto_examples_compose_plot_transformed_target.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/compose/plot_transformed_target
.. raw:: html

    <div style='clear:both'></div>

.. _covariance_examples:

Covariance estimation
---------------------

Examples concerning the :mod:`sklearn.covariance` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and...">

.. only:: html

    .. figure:: /auto_examples/covariance/images/thumb/sphx_glr_plot_lw_vs_oas_thumb.png

        :ref:`sphx_glr_auto_examples_covariance_plot_lw_vs_oas.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/covariance/plot_lw_vs_oas

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using the GraphicalLasso estimator to learn a covariance and sparse precision from a small numb...">

.. only:: html

    .. figure:: /auto_examples/covariance/images/thumb/sphx_glr_plot_sparse_cov_thumb.png

        :ref:`sphx_glr_auto_examples_covariance_plot_sparse_cov.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/covariance/plot_sparse_cov

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When working with covariance estimation, the usual approach is to use a maximum likelihood esti...">

.. only:: html

    .. figure:: /auto_examples/covariance/images/thumb/sphx_glr_plot_covariance_estimation_thumb.png

        :ref:`sphx_glr_auto_examples_covariance_plot_covariance_estimation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/covariance/plot_covariance_estimation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed...">

.. only:: html

    .. figure:: /auto_examples/covariance/images/thumb/sphx_glr_plot_mahalanobis_distances_thumb.png

        :ref:`sphx_glr_auto_examples_covariance_plot_mahalanobis_distances.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/covariance/plot_mahalanobis_distances

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When the amount of contamination is known, this example illustrates three different ways of per...">

.. only:: html

    .. figure:: /auto_examples/covariance/images/thumb/sphx_glr_plot_outlier_detection_thumb.png

        :ref:`sphx_glr_auto_examples_covariance_plot_outlier_detection.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/covariance/plot_outlier_detection

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers ...">

.. only:: html

    .. figure:: /auto_examples/covariance/images/thumb/sphx_glr_plot_robust_vs_empirical_covariance_thumb.png

        :ref:`sphx_glr_auto_examples_covariance_plot_robust_vs_empirical_covariance.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/covariance/plot_robust_vs_empirical_covariance
.. raw:: html

    <div style='clear:both'></div>

.. _cross_decomposition_examples:

Cross decomposition
-------------------

Examples concerning the :mod:`sklearn.cross_decomposition` module.




.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with mu...">

.. only:: html

    .. figure:: /auto_examples/cross_decomposition/images/thumb/sphx_glr_plot_compare_cross_decomposition_thumb.png

        :ref:`sphx_glr_auto_examples_cross_decomposition_plot_compare_cross_decomposition.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/cross_decomposition/plot_compare_cross_decomposition
.. raw:: html

    <div style='clear:both'></div>

.. _dataset_examples:

Dataset examples
-----------------------

Examples concerning the :mod:`sklearn.datasets` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This dataset is made up of 1797 8x8 images. Each image, like the one shown below, is of a hand-...">

.. only:: html

    .. figure:: /auto_examples/datasets/images/thumb/sphx_glr_plot_digits_last_image_thumb.png

        :ref:`sphx_glr_auto_examples_datasets_plot_digits_last_image.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/datasets/plot_digits_last_image

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The rows being the samples and the columns being: Sepal Length, Sepal Width, Petal Length and P...">

.. only:: html

    .. figure:: /auto_examples/datasets/images/thumb/sphx_glr_plot_iris_dataset_thumb.png

        :ref:`sphx_glr_auto_examples_datasets_plot_iris_dataset.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/datasets/plot_iris_dataset

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot several randomly generated 2D classification datasets. This example illustrates the :func:...">

.. only:: html

    .. figure:: /auto_examples/datasets/images/thumb/sphx_glr_plot_random_dataset_thumb.png

        :ref:`sphx_glr_auto_examples_datasets_plot_random_dataset.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/datasets/plot_random_dataset

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This illustrates the `datasets.make_multilabel_classification` dataset generator. Each sample c...">

.. only:: html

    .. figure:: /auto_examples/datasets/images/thumb/sphx_glr_plot_random_multilabel_dataset_thumb.png

        :ref:`sphx_glr_auto_examples_datasets_plot_random_multilabel_dataset.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/datasets/plot_random_multilabel_dataset
.. raw:: html

    <div style='clear:both'></div>

.. _decomposition_examples:

Decomposition
-------------

Examples concerning the :mod:`sklearn.decomposition` module.




.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A plot that compares the various Beta-divergence loss functions supported by the Multiplicative...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_beta_divergence_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_beta_divergence.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_beta_divergence

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Principal Component Analysis applied to the Iris dataset.">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_pca_iris_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_pca_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_pca_iris

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Incremental principal component analysis (IPCA) is typically used as a replacement for principa...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_incremental_pca_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_incremental_pca.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_incremental_pca

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour and Virginica) with 4 a...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_pca_vs_lda_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_pca_vs_lda.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_pca_vs_lda

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example of estimating sources from noisy data.">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_ica_blind_source_separation_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_ica_blind_source_separation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_ica_blind_source_separation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="These figures aid in illustrating how a point cloud can be very flat in one direction--which is...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_pca_3d_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_pca_3d.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_pca_3d

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates visually in the feature space a comparison by results using two differ...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_ica_vs_pca_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_ica_vs_pca.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_ica_vs_pca

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows that Kernel PCA is able to find a projection of the data that makes data lin...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_kernel_pca_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_kernel_pca.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_kernel_pca

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Transform a signal as a sparse combination of Ricker wavelets. This example visually compares d...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_sparse_coding_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_sparse_coding.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_sparse_coding

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the lik...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_pca_vs_fa_model_selection_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_pca_vs_fa_model_selection.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_pca_vs_fa_model_selection

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example comparing the effect of reconstructing noisy fragments of a raccoon face image using...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_image_denoising_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_image_denoising.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_image_denoising

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dime...">

.. only:: html

    .. figure:: /auto_examples/decomposition/images/thumb/sphx_glr_plot_faces_decomposition_thumb.png

        :ref:`sphx_glr_auto_examples_decomposition_plot_faces_decomposition.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/decomposition/plot_faces_decomposition
.. raw:: html

    <div style='clear:both'></div>

.. _ensemble_examples:

Ensemble methods
----------------

Examples concerning the :mod:`sklearn.ensemble` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A decision tree is boosted using the AdaBoost.R2 [1]_ algorithm on a 1D sinusoidal dataset with...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_adaboost_regression_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_regression.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_adaboost_regression

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows the use of forests of trees to evaluate the importance of the pixels in an i...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_forest_importances_faces_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_forest_importances_faces.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_forest_importances_faces

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This examples shows the use of forests of trees to evaluate the importance of features on an ar...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_forest_importances_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_forest_importances.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_forest_importances

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example using :class:`sklearn.ensemble.IsolationForest` for anomaly detection.">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_isolation_forest_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_isolation_forest.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_isolation_forest

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the decision boundaries of a `VotingClassifier` for two features of the Iris dataset.">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_voting_decision_regions_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_voting_decision_regions.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_voting_decision_regions

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example to compare multi-output regression with random forest and the :ref:`multioutput.Mult...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_random_forest_regression_multioutput_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_random_forest_regression_multioutput.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_random_forest_regression_multioutput

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how quantile regression can be used to create prediction intervals. ">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_gradient_boosting_quantile_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_quantile.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_gradient_boosting_quantile

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustration of the effect of different regularization strategies for Gradient Boosting. The ex...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_gradient_boosting_regularization_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regularization.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_gradient_boosting_regularization

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the class probabilities of the first sample in a toy dataset predicted by three different ...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_voting_probas_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_voting_probas.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_voting_probas

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate Gradient Boosting on the Boston housing dataset.">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_gradient_boosting_regression_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regression.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_gradient_boosting_regression

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_ensemble_oob_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_ensemble_oob.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_ensemble_oob

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example fits an AdaBoosted decision stump on a non-linearly separable classification datas...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_adaboost_twoclass_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_twoclass.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_adaboost_twoclass

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="RandomTreesEmbedding provides a way to map data to a very high-dimensional, sparse representati...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_random_forest_embedding_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_random_forest_embedding.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_random_forest_embedding

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Partial dependence plots show the dependence between the target function [2]_ and a set of &#x27;tar...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_partial_dependence_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_partial_dependence.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_partial_dependence

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example is based on Figure 10.2 from Hastie et al 2009 [1]_ and illustrates the difference...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_adaboost_hastie_10_2_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_hastie_10_2.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_adaboost_hastie_10_2

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example reproduces Figure 1 of Zhu et al [1]_ and shows how boosting can improve predictio...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_adaboost_multiclass_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_multiclass.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_adaboost_multiclass

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Gradient boosting is an ensembling technique where several weak learners (regression trees) are...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_gradient_boosting_early_stopping_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_gradient_boosting_early_stopping

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Transform your features into a higher dimensional, sparse space. Then train a linear model on t...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_feature_transformation_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_feature_transformation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_feature_transformation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Out-of-bag (OOB) estimates can be a useful heuristic to estimate the &quot;optimal&quot; number of boosti...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_gradient_boosting_oob_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_oob.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_gradient_boosting_oob

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates and compares the bias-variance decomposition of the expected mean squa...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_bias_variance_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_bias_variance.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_bias_variance

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the decision surfaces of forests of randomized trees trained on pairs of features of the i...">

.. only:: html

    .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_forest_iris_thumb.png

        :ref:`sphx_glr_auto_examples_ensemble_plot_forest_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/ensemble/plot_forest_iris
.. raw:: html

    <div style='clear:both'></div>

Tutorial exercises
------------------

Exercises for the tutorials



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A tutorial exercise regarding the use of classification techniques on the Digits dataset.">

.. only:: html

    .. figure:: /auto_examples/exercises/images/thumb/sphx_glr_plot_digits_classification_exercise_thumb.png

        :ref:`sphx_glr_auto_examples_exercises_plot_digits_classification_exercise.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/exercises/plot_digits_classification_exercise

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A tutorial exercise using Cross-validation with an SVM on the Digits dataset.">

.. only:: html

    .. figure:: /auto_examples/exercises/images/thumb/sphx_glr_plot_cv_digits_thumb.png

        :ref:`sphx_glr_auto_examples_exercises_plot_cv_digits.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/exercises/plot_cv_digits

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A tutorial exercise for using different SVM kernels.">

.. only:: html

    .. figure:: /auto_examples/exercises/images/thumb/sphx_glr_plot_iris_exercise_thumb.png

        :ref:`sphx_glr_auto_examples_exercises_plot_iris_exercise.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/exercises/plot_iris_exercise

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A tutorial exercise which uses cross-validation with linear models.">

.. only:: html

    .. figure:: /auto_examples/exercises/images/thumb/sphx_glr_plot_cv_diabetes_thumb.png

        :ref:`sphx_glr_auto_examples_exercises_plot_cv_diabetes.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/exercises/plot_cv_diabetes
.. raw:: html

    <div style='clear:both'></div>

.. _feature_selection_examples:

Feature Selection
-----------------------

Examples concerning the :mod:`sklearn.feature_selection` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A recursive feature elimination example showing the relevance of pixels in a digit classificati...">

.. only:: html

    .. figure:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_rfe_digits_thumb.png

        :ref:`sphx_glr_auto_examples_feature_selection_plot_rfe_digits.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/feature_selection/plot_rfe_digits

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the differences between univariate F-test statistics and mutual inform...">

.. only:: html

    .. figure:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_f_test_vs_mi_thumb.png

        :ref:`sphx_glr_auto_examples_feature_selection_plot_f_test_vs_mi.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/feature_selection/plot_f_test_vs_mi

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple usage of Pipeline that runs successively a univariate feature selection with anova and t...">

.. only:: html

    .. figure:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_feature_selection_pipeline_thumb.png

        :ref:`sphx_glr_auto_examples_feature_selection_plot_feature_selection_pipeline.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/feature_selection/plot_feature_selection_pipeline

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A recursive feature elimination example with automatic tuning of the number of features selecte...">

.. only:: html

    .. figure:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_rfe_with_cross_validation_thumb.png

        :ref:`sphx_glr_auto_examples_feature_selection_plot_rfe_with_cross_validation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/feature_selection/plot_rfe_with_cross_validation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use SelectFromModel meta-transformer along with Lasso to select the best couple of features fro...">

.. only:: html

    .. figure:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_select_from_model_boston_thumb.png

        :ref:`sphx_glr_auto_examples_feature_selection_plot_select_from_model_boston.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/feature_selection/plot_select_from_model_boston

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In order to test if a classification score is significative a technique in repeating the classi...">

.. only:: html

    .. figure:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_permutation_test_for_classification_thumb.png

        :ref:`sphx_glr_auto_examples_feature_selection_plot_permutation_test_for_classification.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/feature_selection/plot_permutation_test_for_classification

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example showing univariate feature selection.">

.. only:: html

    .. figure:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_feature_selection_thumb.png

        :ref:`sphx_glr_auto_examples_feature_selection_plot_feature_selection.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/feature_selection/plot_feature_selection
.. raw:: html

    <div style='clear:both'></div>

.. _gaussian_process_examples:

Gaussian Process for Machine Learning
-------------------------------------

Examples concerning the :mod:`sklearn.gaussian_process` module.




.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates GPC on XOR data. Compared are a stationary, isotropic kernel (RBF) and...">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_gpc_xor_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_gpc_xor.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_gpc_xor

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the predicted probability of GPC for an isotropic and anisotropic RBF ...">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_gpc_iris_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_gpc_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_gpc_iris

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Both kernel ridge regression (KRR) and Gaussian process regression (GPR) learn a target functio...">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_compare_gpr_krr_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_compare_gpr_krr.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_compare_gpr_krr

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example is based on Section 5.4.3 of &quot;Gaussian Processes for Machine Learning&quot; [RW2006]. I...">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_gpr_co2_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_gpr_co2.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_gpr_co2

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the prior and posterior of a GPR with different kernels. Mean, standar...">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_gpr_prior_posterior_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_gpr_prior_posterior.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_gpr_prior_posterior

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A two-dimensional classification example showing iso-probability lines for the predicted probab...">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_gpc_isoprobability_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_gpc_isoprobability.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_gpc_isoprobability

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the predicted probability of GPC for an RBF kernel with different choi...">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_gpc_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_gpc.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_gpc

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates that GPR with a sum-kernel including a WhiteKernel can estimate the no...">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_gpr_noisy_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_gpr_noisy.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_gpr_noisy

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A simple one-dimensional regression example computed in two different ways:">

.. only:: html

    .. figure:: /auto_examples/gaussian_process/images/thumb/sphx_glr_plot_gpr_noisy_targets_thumb.png

        :ref:`sphx_glr_auto_examples_gaussian_process_plot_gpr_noisy_targets.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/gaussian_process/plot_gpr_noisy_targets
.. raw:: html

    <div style='clear:both'></div>

.. _linear_examples:

Generalized Linear Models
-------------------------

Examples concerning the :mod:`sklearn.linear_model` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Computes Lasso Path along the regularization parameter using the LARS algorithm on the diabetes...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_lasso_lars_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_lars.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_lasso_lars

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Shows the effect of collinearity in the coefficients of an estimator.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_ridge_path_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_ridge_path.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_ridge_path

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the maximum margin separating hyperplane within a two-class separable dataset using a line...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sgd_separating_hyperplane_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sgd_separating_hyperplane.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sgd_separating_hyperplane

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Computes path on IRIS dataset.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_logistic_path_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_logistic_path.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_logistic_path

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A plot that compares the various convex loss functions supported by :class:`sklearn.linear_mode...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sgd_loss_functions_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sgd_loss_functions.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sgd_loss_functions

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip=":class:`Ridge` Regression is the estimator used in this example. Each color in the left plot re...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_ridge_coeffs_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_ridge_coeffs.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_ridge_coeffs

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Contours of where the penalty is equal to 1 for the three penalties L1, L2 and elastic-net.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sgd_penalties_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sgd_penalties.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sgd_penalties

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ridge regression is basically minimizing a penalised version of the least-squared function. The...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_ols_ridge_variance_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_ols_ridge_variance.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_ols_ridge_variance

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Shown in the plot is how the logistic regression would, in this synthetic dataset, classify val...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_logistic_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_logistic.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_logistic

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to approximate a function with a polynomial of degree n_degree by...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_polynomial_interpolation_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_polynomial_interpolation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_polynomial_interpolation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show below is a logistic-regression classifiers decision boundaries on the `iris &lt;https://en.wi...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_iris_logistic_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_iris_logistic.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_iris_logistic

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot decision function of a weighted dataset, where the size of points is proportional to its w...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sgd_weighted_samples_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sgd_weighted_samples.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sgd_weighted_samples

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The coefficients, the residual sum of squares and the variance score are also calculated.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_ols_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_ols.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_ols

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example we see how to robustly fit a linear model to faulty data using the RANSAC algor...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_ransac_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_ransac.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_ransac

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that alth...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_ols_3d_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_ols_3d.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_ols_3d

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="We show that linear_model.Lasso provides the same results for dense and sparse data and that in...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_lasso_dense_vs_sparse_data_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_dense_vs_sparse_data.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_lasso_dense_vs_sparse_data

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Fit Ridge and HuberRegressor on a dataset with outliers.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_huber_vs_ridge_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_huber_vs_ridge.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_huber_vs_ridge

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example showing how different online solvers perform on the hand-written digits dataset.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sgd_comparison_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sgd_comparison.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sgd_comparison

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected ...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_multi_task_lasso_support_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_multi_task_lasso_support.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_multi_task_lasso_support

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Estimates Lasso and Elastic-Net regression models on a manually generated sparse signal corrupt...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_lasso_and_elasticnet_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_and_elasticnet.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_lasso_and_elasticnet

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Here we fit a multinomial logistic regression with L1 penalty on a subset of the MNIST digits c...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sparse_logistic_regression_mnist_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sparse_logistic_regression_mnist.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sparse_logistic_regression_mnist

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encod...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_omp_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_omp.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_omp

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the ...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sgd_iris_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sgd_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sgd_iris

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Comparison of the sparsity (percentage of zero coefficients) of solutions when L1 and L2 penalt...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_logistic_l1_l2_sparsity_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_logistic_l1_l2_sparsity.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_logistic_l1_l2_sparsity

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Computes a Theil-Sen Regression on a synthetic dataset.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_theilsen_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_theilsen.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_theilsen

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot decision surface of multinomial and One-vs-Rest Logistic Regression. The hyperplanes corre...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_logistic_multinomial_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_logistic_multinomial.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_logistic_multinomial

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Here a sine function is fit with a polynomial of order 3, for values close to zero.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_robust_fit_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_robust_fit.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_robust_fit

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Lasso and elastic net (L1 and L2 penalisation) implemented using a coordinate descent.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_lasso_coordinate_descent_path_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_coordinate_descent_path.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_lasso_coordinate_descent_path

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Fit regression model with Bayesian Ridge Regression.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_ard_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_ard.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_ard

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Computes a Bayesian Ridge Regression on a synthetic dataset.">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_bayesian_ridge_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_bayesian_ridge.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_bayesian_ridge

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use the Akaike information criterion (AIC), the Bayes Information criterion (BIC) and cross-val...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_lasso_model_selection_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_model_selection.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_lasso_model_selection

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Comparison of multinomial logistic L1 vs one-versus-rest L1 logistic regression to classify doc...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sparse_logistic_regression_20newsgroups_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sparse_logistic_regression_20newsgroups.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sparse_logistic_regression_20newsgroups

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Stochastic Gradient Descent is an optimization technique which minimizes a loss function in a s...">

.. only:: html

    .. figure:: /auto_examples/linear_model/images/thumb/sphx_glr_plot_sgd_early_stopping_thumb.png

        :ref:`sphx_glr_auto_examples_linear_model_plot_sgd_early_stopping.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/linear_model/plot_sgd_early_stopping
.. raw:: html

    <div style='clear:both'></div>

.. _manifold_examples:

Manifold learning
-----------------------

Examples concerning the :mod:`sklearn.manifold` module.




.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An illustration of Swiss Roll reduction with locally linear embedding ">

.. only:: html

    .. figure:: /auto_examples/manifold/images/thumb/sphx_glr_plot_swissroll_thumb.png

        :ref:`sphx_glr_auto_examples_manifold_plot_swissroll.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/manifold/plot_swissroll

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An illustration of the metric and non-metric MDS on generated noisy data.">

.. only:: html

    .. figure:: /auto_examples/manifold/images/thumb/sphx_glr_plot_mds_thumb.png

        :ref:`sphx_glr_auto_examples_manifold_plot_mds.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/manifold/plot_mds

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An illustration of t-SNE on the two concentric circles and the S-curve datasets for different p...">

.. only:: html

    .. figure:: /auto_examples/manifold/images/thumb/sphx_glr_plot_t_sne_perplexity_thumb.png

        :ref:`sphx_glr_auto_examples_manifold_plot_t_sne_perplexity.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/manifold/plot_t_sne_perplexity

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An illustration of dimensionality reduction on the S-curve dataset with various manifold learni...">

.. only:: html

    .. figure:: /auto_examples/manifold/images/thumb/sphx_glr_plot_compare_methods_thumb.png

        :ref:`sphx_glr_auto_examples_manifold_plot_compare_methods.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/manifold/plot_compare_methods

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An application of the different :ref:`manifold` techniques on a spherical data-set. Here one ca...">

.. only:: html

    .. figure:: /auto_examples/manifold/images/thumb/sphx_glr_plot_manifold_sphere_thumb.png

        :ref:`sphx_glr_auto_examples_manifold_plot_manifold_sphere.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/manifold/plot_manifold_sphere

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An illustration of various embeddings on the digits dataset.">

.. only:: html

    .. figure:: /auto_examples/manifold/images/thumb/sphx_glr_plot_lle_digits_thumb.png

        :ref:`sphx_glr_auto_examples_manifold_plot_lle_digits.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/manifold/plot_lle_digits
.. raw:: html

    <div style='clear:both'></div>

.. _mixture_examples:

Gaussian Mixture Models
-----------------------

Examples concerning the :mod:`sklearn.mixture` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians...">

.. only:: html

    .. figure:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_pdf_thumb.png

        :ref:`sphx_glr_auto_examples_mixture_plot_gmm_pdf.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/mixture/plot_gmm_pdf

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the confidence ellipsoids of a mixture of two Gaussians obtained with Expectation Maximisa...">

.. only:: html

    .. figure:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_thumb.png

        :ref:`sphx_glr_auto_examples_mixture_plot_gmm.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/mixture/plot_gmm

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows that model selection can be performed with Gaussian Mixture Models using inf...">

.. only:: html

    .. figure:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_selection_thumb.png

        :ref:`sphx_glr_auto_examples_mixture_plot_gmm_selection.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/mixture/plot_gmm_selection

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of several covariances types for Gaussian mixture models.">

.. only:: html

    .. figure:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_covariances_thumb.png

        :ref:`sphx_glr_auto_examples_mixture_plot_gmm_covariances.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/mixture/plot_gmm_covariances

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the behavior of Gaussian mixture models fit on data that was not samp...">

.. only:: html

    .. figure:: /auto_examples/mixture/images/thumb/sphx_glr_plot_gmm_sin_thumb.png

        :ref:`sphx_glr_auto_examples_mixture_plot_gmm_sin.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/mixture/plot_gmm_sin

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example plots the ellipsoids obtained from a toy dataset (mixture of three Gaussians) fitt...">

.. only:: html

    .. figure:: /auto_examples/mixture/images/thumb/sphx_glr_plot_concentration_prior_thumb.png

        :ref:`sphx_glr_auto_examples_mixture_plot_concentration_prior.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/mixture/plot_concentration_prior
.. raw:: html

    <div style='clear:both'></div>

.. _model_selection_examples:

Model Selection
-----------------------

Examples related to the :mod:`sklearn.model_selection` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to use `cross_val_predict` to visualize prediction errors.">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_cv_predict_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_cv_predict.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_cv_predict

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this plot you can see the training scores and validation scores of an SVM for different valu...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_validation_curve_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_validation_curve.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_validation_curve

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the problems of underfitting and overfitting and how we can use linea...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_underfitting_overfitting_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_underfitting_overfitting.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_underfitting_overfitting

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This examples shows how a classifier is optimized by cross-validation, which is done using the ...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_grid_search_digits_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_grid_search_digits.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_grid_search_digits

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustration of how the performance of an estimator on unseen data (test data) is not the same ...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_train_error_vs_test_error_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_train_error_vs_test_error.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_train_error_vs_test_error

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_roc_crossval_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_roc_crossval.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_roc_crossval

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of confusion matrix usage to evaluate the quality of the output of a classifier on the ...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_confusion_matrix_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_confusion_matrix.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_confusion_matrix

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Compare randomized search and grid search for optimizing hyperparameters of a random forest. Al...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_randomized_search_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_randomized_search.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_randomized_search

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example compares non-nested and nested cross-validation strategies on a classifier of the ...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_nested_cross_validation_iris_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_nested_cross_validation_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_nested_cross_validation_iris

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Multiple metric parameter search can be done by setting the ``scoring`` parameter to a list of ...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_multi_metric_evaluation_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_multi_metric_evaluation.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_multi_metric_evaluation

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The dataset used in this example is the 20 newsgroups dataset which will be automatically downl...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_grid_search_text_feature_extraction_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_grid_search_text_feature_extraction.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/grid_search_text_feature_extraction

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_roc_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_roc.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_roc

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset...">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_learning_curve_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_learning_curve.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_learning_curve

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of Precision-Recall metric to evaluate classifier output quality.">

.. only:: html

    .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_precision_recall_thumb.png

        :ref:`sphx_glr_auto_examples_model_selection_plot_precision_recall.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/model_selection/plot_precision_recall
.. raw:: html

    <div style='clear:both'></div>

.. _multioutput_examples:

Multioutput methods
-------------------

Examples concerning the :mod:`sklearn.multioutput` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="For this example we will use the `yeast &lt;http://mldata.org/repository/data/viewslug/yeast&gt;`_ da...">

.. only:: html

    .. figure:: /auto_examples/multioutput/images/thumb/sphx_glr_plot_classifier_chain_yeast_thumb.png

        :ref:`sphx_glr_auto_examples_multioutput_plot_classifier_chain_yeast.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/multioutput/plot_classifier_chain_yeast
.. raw:: html

    <div style='clear:both'></div>

.. _neighbors_examples:

Nearest Neighbors
-----------------------

Examples concerning the :mod:`sklearn.neighbors` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example presents the Local Outlier Factor (LOF) estimator. The LOF algorithm is an unsuper...">

.. only:: html

    .. figure:: /auto_examples/neighbors/images/thumb/sphx_glr_plot_lof_thumb.png

        :ref:`sphx_glr_auto_examples_neighbors_plot_lof.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neighbors/plot_lof

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate the resolution of a regression problem using a k-Nearest Neighbor and the interpola...">

.. only:: html

    .. figure:: /auto_examples/neighbors/images/thumb/sphx_glr_plot_regression_thumb.png

        :ref:`sphx_glr_auto_examples_neighbors_plot_regression.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neighbors/plot_regression

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sample usage of Nearest Neighbors classification. It will plot the decision boundaries for each...">

.. only:: html

    .. figure:: /auto_examples/neighbors/images/thumb/sphx_glr_plot_classification_thumb.png

        :ref:`sphx_glr_auto_examples_neighbors_plot_classification.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neighbors/plot_classification

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each ...">

.. only:: html

    .. figure:: /auto_examples/neighbors/images/thumb/sphx_glr_plot_nearest_centroid_thumb.png

        :ref:`sphx_glr_auto_examples_neighbors_plot_nearest_centroid.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neighbors/plot_nearest_centroid

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how kernel density estimation (KDE), a powerful non-parametric density estim...">

.. only:: html

    .. figure:: /auto_examples/neighbors/images/thumb/sphx_glr_plot_digits_kde_sampling_thumb.png

        :ref:`sphx_glr_auto_examples_neighbors_plot_digits_kde_sampling.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neighbors/plot_digits_kde_sampling

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example does not perform any learning over the data (see :ref:`sphx_glr_auto_examples_appl...">

.. only:: html

    .. figure:: /auto_examples/neighbors/images/thumb/sphx_glr_plot_species_kde_thumb.png

        :ref:`sphx_glr_auto_examples_neighbors_plot_species_kde.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neighbors/plot_species_kde

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The first plot shows one of the problems with using histograms to visualize the density of poin...">

.. only:: html

    .. figure:: /auto_examples/neighbors/images/thumb/sphx_glr_plot_kde_1d_thumb.png

        :ref:`sphx_glr_auto_examples_neighbors_plot_kde_1d.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neighbors/plot_kde_1d
.. raw:: html

    <div style='clear:both'></div>

.. _neural_network_examples:

Neural Networks
-----------------------

Examples concerning the :mod:`sklearn.neural_network` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes looking at the learned coefficients of a neural network can provide insight into the ...">

.. only:: html

    .. figure:: /auto_examples/neural_networks/images/thumb/sphx_glr_plot_mnist_filters_thumb.png

        :ref:`sphx_glr_auto_examples_neural_networks_plot_mnist_filters.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neural_networks/plot_mnist_filters

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example visualizes some training loss curves for different stochastic learning strategies,...">

.. only:: html

    .. figure:: /auto_examples/neural_networks/images/thumb/sphx_glr_plot_mlp_training_curves_thumb.png

        :ref:`sphx_glr_auto_examples_neural_networks_plot_mlp_training_curves.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neural_networks/plot_mlp_training_curves

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="For greyscale image data where pixel values can be interpreted as degrees of blackness on a whi...">

.. only:: html

    .. figure:: /auto_examples/neural_networks/images/thumb/sphx_glr_plot_rbm_logistic_classification_thumb.png

        :ref:`sphx_glr_auto_examples_neural_networks_plot_rbm_logistic_classification.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neural_networks/plot_rbm_logistic_classification

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A comparison of different values for regularization parameter &#x27;alpha&#x27; on synthetic datasets. Th...">

.. only:: html

    .. figure:: /auto_examples/neural_networks/images/thumb/sphx_glr_plot_mlp_alpha_thumb.png

        :ref:`sphx_glr_auto_examples_neural_networks_plot_mlp_alpha.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/neural_networks/plot_mlp_alpha
.. raw:: html

    <div style='clear:both'></div>

.. _preprocessing_examples:

Preprocessing
-------------

Examples concerning the :mod:`sklearn.preprocessing` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Shows how to use a function transformer in a pipeline. If you know your dataset&#x27;s first princip...">

.. only:: html

    .. figure:: /auto_examples/preprocessing/images/thumb/sphx_glr_plot_function_transformer_thumb.png

        :ref:`sphx_glr_auto_examples_preprocessing_plot_function_transformer.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/preprocessing/plot_function_transformer

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The example compares prediction result of linear regression (linear model) and decision tree (t...">

.. only:: html

    .. figure:: /auto_examples/preprocessing/images/thumb/sphx_glr_plot_discretization_thumb.png

        :ref:`sphx_glr_auto_examples_preprocessing_plot_discretization.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/preprocessing/plot_discretization

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the use of the Box-Cox transform through :class:`preprocessing.PowerT...">

.. only:: html

    .. figure:: /auto_examples/preprocessing/images/thumb/sphx_glr_plot_power_transformer_thumb.png

        :ref:`sphx_glr_auto_examples_preprocessing_plot_power_transformer.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/preprocessing/plot_power_transformer

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example presents the different strategies implemented in KBinsDiscretizer:">

.. only:: html

    .. figure:: /auto_examples/preprocessing/images/thumb/sphx_glr_plot_discretization_strategies_thumb.png

        :ref:`sphx_glr_auto_examples_preprocessing_plot_discretization_strategies.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/preprocessing/plot_discretization_strategies

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Feature scaling through standardization (or Z-score normalization) can be an important preproce...">

.. only:: html

    .. figure:: /auto_examples/preprocessing/images/thumb/sphx_glr_plot_scaling_importance_thumb.png

        :ref:`sphx_glr_auto_examples_preprocessing_plot_scaling_importance.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/preprocessing/plot_scaling_importance

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Feature 0 (median income in a block) and feature 5 (number of households) of the `California ho...">

.. only:: html

    .. figure:: /auto_examples/preprocessing/images/thumb/sphx_glr_plot_all_scaling_thumb.png

        :ref:`sphx_glr_auto_examples_preprocessing_plot_all_scaling.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/preprocessing/plot_all_scaling

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A demonstration of feature discretization on synthetic classification datasets. Feature discret...">

.. only:: html

    .. figure:: /auto_examples/preprocessing/images/thumb/sphx_glr_plot_discretization_classification_thumb.png

        :ref:`sphx_glr_auto_examples_preprocessing_plot_discretization_classification.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/preprocessing/plot_discretization_classification
.. raw:: html

    <div style='clear:both'></div>

.. _semi_supervised_examples:

Semi Supervised Classification
------------------------------

Examples concerning the :mod:`sklearn.semi_supervised` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Comparison for decision boundary generated on iris dataset between Label Propagation and SVM.">

.. only:: html

    .. figure:: /auto_examples/semi_supervised/images/thumb/sphx_glr_plot_label_propagation_versus_svm_iris_thumb.png

        :ref:`sphx_glr_auto_examples_semi_supervised_plot_label_propagation_versus_svm_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/semi_supervised/plot_label_propagation_versus_svm_iris

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of LabelPropagation learning a complex internal structure to demonstrate &quot;manifold lear...">

.. only:: html

    .. figure:: /auto_examples/semi_supervised/images/thumb/sphx_glr_plot_label_propagation_structure_thumb.png

        :ref:`sphx_glr_auto_examples_semi_supervised_plot_label_propagation_structure.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/semi_supervised/plot_label_propagation_structure

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the power of semisupervised learning by training a Label Spreading mo...">

.. only:: html

    .. figure:: /auto_examples/semi_supervised/images/thumb/sphx_glr_plot_label_propagation_digits_thumb.png

        :ref:`sphx_glr_auto_examples_semi_supervised_plot_label_propagation_digits.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/semi_supervised/plot_label_propagation_digits

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates an active learning technique to learn handwritten digits using label propagation.">

.. only:: html

    .. figure:: /auto_examples/semi_supervised/images/thumb/sphx_glr_plot_label_propagation_digits_active_learning_thumb.png

        :ref:`sphx_glr_auto_examples_semi_supervised_plot_label_propagation_digits_active_learning.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/semi_supervised/plot_label_propagation_digits_active_learning
.. raw:: html

    <div style='clear:both'></div>

.. _svm_examples:

Support Vector Machines
-----------------------

Examples concerning the :mod:`sklearn.svm` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a ...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_svm_nonlinear_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_svm_nonlinear.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_svm_nonlinear

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the maximum margin separating hyperplane within a two-class separable dataset using a Supp...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_separating_hyperplane_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_separating_hyperplane.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_separating_hyperplane

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Toy example of 1D regression using linear, polynomial and RBF kernels.">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_svm_regression_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_svm_regression.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_svm_regression

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_custom_kernel_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_custom_kernel.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_custom_kernel

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot decision function of a weighted dataset, where the size of points is proportional to its w...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_weighted_samples_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_weighted_samples.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_weighted_samples

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Find the optimal separating hyperplane using an SVC for classes that are unbalanced.">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_separating_hyperplane_unbalanced_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_separating_hyperplane_unbalanced.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_separating_hyperplane_unbalanced

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_svm_kernels_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_svm_kernels.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_svm_kernels

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to perform univariate feature selection before running a SVC (support ve...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_svm_anova_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_svm_anova.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_svm_anova

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A small value of `C` includes more/all the observations, allowing the margins to be calculated ...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_svm_margin_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_svm_margin.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_svm_margin

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example using a one-class SVM for novelty detection.">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_oneclass_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_oneclass.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_oneclass

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only ...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_iris_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_iris

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The following example illustrates the effect of scaling the regularization parameter when using...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_svm_scale_c_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_svm_scale_c.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_svm_scale_c

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radial Basis F...">

.. only:: html

    .. figure:: /auto_examples/svm/images/thumb/sphx_glr_plot_rbf_parameters_thumb.png

        :ref:`sphx_glr_auto_examples_svm_plot_rbf_parameters.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/svm/plot_rbf_parameters
.. raw:: html

    <div style='clear:both'></div>

.. _text_examples:

Working with text documents
----------------------------

Examples concerning the :mod:`sklearn.feature_extraction.text` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Compares FeatureHasher and DictVectorizer by using both to vectorize text documents.">

.. only:: html

    .. figure:: /auto_examples/text/images/thumb/sphx_glr_plot_hashing_vs_dict_vectorizer_thumb.png

        :ref:`sphx_glr_auto_examples_text_plot_hashing_vs_dict_vectorizer.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/text/plot_hashing_vs_dict_vectorizer

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example showing how the scikit-learn can be used to cluster documents by topics usin...">

.. only:: html

    .. figure:: /auto_examples/text/images/thumb/sphx_glr_plot_document_clustering_thumb.png

        :ref:`sphx_glr_auto_examples_text_plot_document_clustering.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/text/plot_document_clustering

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example showing how scikit-learn can be used to classify documents by topics using a...">

.. only:: html

    .. figure:: /auto_examples/text/images/thumb/sphx_glr_plot_document_classification_20newsgroups_thumb.png

        :ref:`sphx_glr_auto_examples_text_plot_document_classification_20newsgroups.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/text/plot_document_classification_20newsgroups
.. raw:: html

    <div style='clear:both'></div>

.. _tree_examples:

Decision Trees
--------------

Examples concerning the :mod:`sklearn.tree` module.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A 1D regression with decision tree.">

.. only:: html

    .. figure:: /auto_examples/tree/images/thumb/sphx_glr_plot_tree_regression_thumb.png

        :ref:`sphx_glr_auto_examples_tree_plot_tree_regression.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/tree/plot_tree_regression

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example to illustrate multi-output regression with decision tree.">

.. only:: html

    .. figure:: /auto_examples/tree/images/thumb/sphx_glr_plot_tree_regression_multioutput_thumb.png

        :ref:`sphx_glr_auto_examples_tree_plot_tree_regression_multioutput.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/tree/plot_tree_regression_multioutput

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the decision surface of a decision tree trained on pairs of features of the iris dataset.">

.. only:: html

    .. figure:: /auto_examples/tree/images/thumb/sphx_glr_plot_iris_thumb.png

        :ref:`sphx_glr_auto_examples_tree_plot_iris.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/tree/plot_iris

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The decision tree structure can be analysed to gain further insight on the relation between the...">

.. only:: html

    .. figure:: /auto_examples/tree/images/thumb/sphx_glr_plot_unveil_tree_structure_thumb.png

        :ref:`sphx_glr_auto_examples_tree_plot_unveil_tree_structure.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/tree/plot_unveil_tree_structure
.. raw:: html

    <div style='clear:both'></div>



.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-gallery


  .. container:: sphx-glr-download

    :download:`Download all examples in Python source code: auto_examples_python.zip <//home/ogrisel/code/scikit-learn/doc/auto_examples/auto_examples_python.zip>`



  .. container:: sphx-glr-download

    :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip <//home/ogrisel/code/scikit-learn/doc/auto_examples/auto_examples_jupyter.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
