.. raw:: html


    <style type="text/css">
    div#sidebarbutton {
        /* hide the sidebar collapser, while ensuring vertical arrangement */
        display: none;
    }
    </style>

.. _examples-index:

Examples
========




.. _general_examples:

General examples
----------------

General-purpose and introductory examples for the scikit.





.. raw:: html


    <div class="thumbnailContainer" tooltip="This example shows how to use `cross_val_predict` to visualize prediction errors.">

.. figure:: ./images/thumb/plot_cv_predict.png
   :target: ./plot_cv_predict.html

   :ref:`example_plot_cv_predict.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./plot_cv_predict



.. raw:: html


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

.. figure:: ./images/thumb/feature_stacker.png
   :target: ./feature_stacker.html

   :ref:`example_feature_stacker.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./feature_stacker



.. raw:: html


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

.. figure:: ./images/thumb/plot_isotonic_regression.png
   :target: ./plot_isotonic_regression.html

   :ref:`example_plot_isotonic_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./plot_isotonic_regression



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example shows that imputing the missing values can give better results than discarding the...">

.. figure:: ./images/thumb/missing_values.png
   :target: ./missing_values.html

   :ref:`example_missing_values.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./missing_values



.. raw:: html


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

.. figure:: ./images/thumb/plot_digits_pipe.png
   :target: ./plot_digits_pipe.html

   :ref:`example_plot_digits_pipe.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./plot_digits_pipe



.. raw:: html


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

.. figure:: ./images/thumb/plot_multilabel.png
   :target: ./plot_multilabel.html

   :ref:`example_plot_multilabel.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./plot_multilabel



.. raw:: html


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

.. figure:: ./images/thumb/plot_multioutput_face_completion.png
   :target: ./plot_multioutput_face_completion.html

   :ref:`example_plot_multioutput_face_completion.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./plot_multioutput_face_completion



.. raw:: html


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

.. figure:: ./images/thumb/plot_johnson_lindenstrauss_bound.png
   :target: ./plot_johnson_lindenstrauss_bound.html

   :ref:`example_plot_johnson_lindenstrauss_bound.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./plot_johnson_lindenstrauss_bound



.. raw:: html


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

.. figure:: ./images/thumb/plot_kernel_ridge_regression.png
   :target: ./plot_kernel_ridge_regression.html

   :ref:`example_plot_kernel_ridge_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./plot_kernel_ridge_regression



.. raw:: html


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

.. figure:: ./images/thumb/hetero_feature_union.png
   :target: ./hetero_feature_union.html

   :ref:`example_hetero_feature_union.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./hetero_feature_union



.. raw:: html


    <div class="thumbnailContainer" tooltip="An example illustrating the approximation of the feature map of an RBF kernel.">

.. figure:: ./images/thumb/plot_kernel_approximation.png
   :target: ./plot_kernel_approximation.html

   :ref:`example_plot_kernel_approximation.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ./plot_kernel_approximation


.. raw:: html

    <div class="clearer"></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="thumbnailContainer" tooltip="This is a proof of concept application of Non Negative Matrix Factorization of the term frequen...">

.. figure:: applications/images/thumb/topics_extraction_with_nmf.png
   :target: ./applications/topics_extraction_with_nmf.html

   :ref:`example_applications_topics_extraction_with_nmf.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/topics_extraction_with_nmf



.. raw:: html


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

.. figure:: applications/images/thumb/plot_outlier_detection_housing.png
   :target: ./applications/plot_outlier_detection_housing.html

   :ref:`example_applications_plot_outlier_detection_housing.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/plot_outlier_detection_housing



.. raw:: html


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

.. figure:: applications/images/thumb/plot_tomography_l1_reconstruction.png
   :target: ./applications/plot_tomography_l1_reconstruction.html

   :ref:`example_applications_plot_tomography_l1_reconstruction.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/plot_tomography_l1_reconstruction



.. raw:: html


    <div class="thumbnailContainer" tooltip="The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", ...">

.. figure:: applications/images/thumb/face_recognition.png
   :target: ./applications/face_recognition.html

   :ref:`example_applications_face_recognition.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/face_recognition



.. raw:: html


    <div class="thumbnailContainer" tooltip="Demonstrate how model complexity influences both prediction accuracy and computational performa...">

.. figure:: applications/images/thumb/plot_model_complexity_influence.png
   :target: ./applications/plot_model_complexity_influence.html

   :ref:`example_applications_plot_model_complexity_influence.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/plot_model_complexity_influence



.. raw:: html


    <div class="thumbnailContainer" tooltip="Modeling species' geographic distributions is an important problem in conservation biology. In ...">

.. figure:: applications/images/thumb/plot_species_distribution_modeling.png
   :target: ./applications/plot_species_distribution_modeling.html

   :ref:`example_applications_plot_species_distribution_modeling.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/plot_species_distribution_modeling



.. raw:: html


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

.. figure:: applications/images/thumb/plot_stock_market.png
   :target: ./applications/plot_stock_market.html

   :ref:`example_applications_plot_stock_market.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/plot_stock_market



.. raw:: html


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

.. figure:: applications/images/thumb/wikipedia_principal_eigenvector.png
   :target: ./applications/wikipedia_principal_eigenvector.html

   :ref:`example_applications_wikipedia_principal_eigenvector.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/wikipedia_principal_eigenvector



.. raw:: html


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

.. figure:: applications/images/thumb/plot_prediction_latency.png
   :target: ./applications/plot_prediction_latency.html

   :ref:`example_applications_plot_prediction_latency.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/plot_prediction_latency



.. raw:: html


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

.. figure:: applications/images/thumb/svm_gui.png
   :target: ./applications/svm_gui.html

   :ref:`example_applications_svm_gui.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/svm_gui



.. raw:: html


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

.. figure:: applications/images/thumb/plot_out_of_core_classification.png
   :target: ./applications/plot_out_of_core_classification.html

   :ref:`example_applications_plot_out_of_core_classification.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   applications/plot_out_of_core_classification


.. raw:: html

    <div class="clearer"></div>
    


.. _bicluster_examples:

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

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





.. raw:: html


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

.. figure:: bicluster/images/thumb/plot_spectral_coclustering.png
   :target: ./bicluster/plot_spectral_coclustering.html

   :ref:`example_bicluster_plot_spectral_coclustering.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   bicluster/plot_spectral_coclustering



.. raw:: html


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

.. figure:: bicluster/images/thumb/plot_spectral_biclustering.png
   :target: ./bicluster/plot_spectral_biclustering.html

   :ref:`example_bicluster_plot_spectral_biclustering.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   bicluster/plot_spectral_biclustering



.. raw:: html


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

.. figure:: bicluster/images/thumb/bicluster_newsgroups.png
   :target: ./bicluster/bicluster_newsgroups.html

   :ref:`example_bicluster_bicluster_newsgroups.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   bicluster/bicluster_newsgroups


.. raw:: html

    <div class="clearer"></div>
    


.. _calibration_examples:

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

Examples illustrating the calibration of predicted probabilities of classifiers.





.. raw:: html


    <div class="thumbnailContainer" tooltip="Well calibrated classifiers are probabilistic classifiers for which the output of the predict_p...">

.. figure:: calibration/images/thumb/plot_compare_calibration.png
   :target: ./calibration/plot_compare_calibration.html

   :ref:`example_calibration_plot_compare_calibration.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   calibration/plot_compare_calibration



.. raw:: html


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

.. figure:: calibration/images/thumb/plot_calibration_curve.png
   :target: ./calibration/plot_calibration_curve.html

   :ref:`example_calibration_plot_calibration_curve.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   calibration/plot_calibration_curve



.. raw:: html


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

.. figure:: calibration/images/thumb/plot_calibration.png
   :target: ./calibration/plot_calibration.html

   :ref:`example_calibration_plot_calibration.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   calibration/plot_calibration



.. raw:: html


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

.. figure:: calibration/images/thumb/plot_calibration_multiclass.png
   :target: ./calibration/plot_calibration_multiclass.html

   :ref:`example_calibration_plot_calibration_multiclass.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   calibration/plot_calibration_multiclass


.. raw:: html

    <div class="clearer"></div>
    


.. _classification_examples:

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

General examples about classification algorithms.





.. raw:: html


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

.. figure:: classification/images/thumb/plot_digits_classification.png
   :target: ./classification/plot_digits_classification.html

   :ref:`example_classification_plot_digits_classification.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   classification/plot_digits_classification



.. raw:: html


    <div class="thumbnailContainer" tooltip="Shows how shrinkage improves classification. ">

.. figure:: classification/images/thumb/plot_lda.png
   :target: ./classification/plot_lda.html

   :ref:`example_classification_plot_lda.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   classification/plot_lda



.. raw:: html


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

.. figure:: classification/images/thumb/plot_classification_probability.png
   :target: ./classification/plot_classification_probability.html

   :ref:`example_classification_plot_classification_probability.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   classification/plot_classification_probability



.. raw:: html


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

.. figure:: classification/images/thumb/plot_classifier_comparison.png
   :target: ./classification/plot_classifier_comparison.html

   :ref:`example_classification_plot_classifier_comparison.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   classification/plot_classifier_comparison



.. raw:: html


    <div class="thumbnailContainer" tooltip="Plot the confidence ellipsoids of each class and decision boundary ">

.. figure:: classification/images/thumb/plot_lda_qda.png
   :target: ./classification/plot_lda_qda.html

   :ref:`example_classification_plot_lda_qda.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   classification/plot_lda_qda


.. raw:: html

    <div class="clearer"></div>
    


.. _cluster_examples:

Clustering
----------

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





.. raw:: html


    <div class="thumbnailContainer" tooltip="Reference:">

.. figure:: cluster/images/thumb/plot_mean_shift.png
   :target: ./cluster/plot_mean_shift.html

   :ref:`example_cluster_plot_mean_shift.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_mean_shift



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_lena_ward_segmentation.png
   :target: ./cluster/plot_lena_ward_segmentation.html

   :ref:`example_cluster_plot_lena_ward_segmentation.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_lena_ward_segmentation



.. raw:: html


    <div class="thumbnailContainer" tooltip="These images how similar features are merged together using feature agglomeration. ">

.. figure:: cluster/images/thumb/plot_digits_agglomeration.png
   :target: ./cluster/plot_digits_agglomeration.html

   :ref:`example_cluster_plot_digits_agglomeration.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_digits_agglomeration



.. raw:: html


    <div class="thumbnailContainer" tooltip="Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Poin...">

.. figure:: cluster/images/thumb/plot_affinity_propagation.png
   :target: ./cluster/plot_affinity_propagation.html

   :ref:`example_cluster_plot_affinity_propagation.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_affinity_propagation



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_agglomerative_clustering.png
   :target: ./cluster/plot_agglomerative_clustering.html

   :ref:`example_cluster_plot_agglomerative_clustering.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_agglomerative_clustering



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_lena_segmentation.png
   :target: ./cluster/plot_lena_segmentation.html

   :ref:`example_cluster_plot_lena_segmentation.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_lena_segmentation



.. raw:: html


    <div class="thumbnailContainer" tooltip="Finds core samples of high density and expands clusters from them.">

.. figure:: cluster/images/thumb/plot_dbscan.png
   :target: ./cluster/plot_dbscan.html

   :ref:`example_cluster_plot_dbscan.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_dbscan



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_dict_face_patches.png
   :target: ./cluster/plot_dict_face_patches.html

   :ref:`example_cluster_plot_dict_face_patches.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_dict_face_patches



.. raw:: html


    <div class="thumbnailContainer" tooltip="The classic image processing example, Lena, an 8-bit grayscale bit-depth, 512 x 512 sized image...">

.. figure:: cluster/images/thumb/plot_lena_compress.png
   :target: ./cluster/plot_lena_compress.html

   :ref:`example_cluster_plot_lena_compress.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_lena_compress



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_ward_structured_vs_unstructured.png
   :target: ./cluster/plot_ward_structured_vs_unstructured.html

   :ref:`example_cluster_plot_ward_structured_vs_unstructured.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_ward_structured_vs_unstructured



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_segmentation_toy.png
   :target: ./cluster/plot_segmentation_toy.html

   :ref:`example_cluster_plot_segmentation_toy.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_segmentation_toy



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_cluster_iris.png
   :target: ./cluster/plot_cluster_iris.html

   :ref:`example_cluster_plot_cluster_iris.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_cluster_iris



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_digits_linkage.png
   :target: ./cluster/plot_digits_linkage.html

   :ref:`example_cluster_plot_digits_linkage.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_digits_linkage



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_color_quantization.png
   :target: ./cluster/plot_color_quantization.html

   :ref:`example_cluster_plot_color_quantization.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_color_quantization



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_birch_vs_minibatchkmeans.png
   :target: ./cluster/plot_birch_vs_minibatchkmeans.html

   :ref:`example_cluster_plot_birch_vs_minibatchkmeans.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_birch_vs_minibatchkmeans



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example compares 2 dimensionality reduction strategies:">

.. figure:: cluster/images/thumb/plot_feature_agglomeration_vs_univariate_selection.png
   :target: ./cluster/plot_feature_agglomeration_vs_univariate_selection.html

   :ref:`example_cluster_plot_feature_agglomeration_vs_univariate_selection.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_feature_agglomeration_vs_univariate_selection



.. raw:: html


    <div class="thumbnailContainer" tooltip="Demonstrates the effect of different metrics on the hierarchical clustering.">

.. figure:: cluster/images/thumb/plot_agglomerative_clustering_metrics.png
   :target: ./cluster/plot_agglomerative_clustering_metrics.html

   :ref:`example_cluster_plot_agglomerative_clustering_metrics.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_agglomerative_clustering_metrics



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_kmeans_stability_low_dim_dense.png
   :target: ./cluster/plot_kmeans_stability_low_dim_dense.html

   :ref:`example_cluster_plot_kmeans_stability_low_dim_dense.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_kmeans_stability_low_dim_dense



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_kmeans_digits.png
   :target: ./cluster/plot_kmeans_digits.html

   :ref:`example_cluster_plot_kmeans_digits.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_kmeans_digits



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_adjusted_for_chance_measures.png
   :target: ./cluster/plot_adjusted_for_chance_measures.html

   :ref:`example_cluster_plot_adjusted_for_chance_measures.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_adjusted_for_chance_measures



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example aims at showing characteristics of different clustering algorithms on datasets tha...">

.. figure:: cluster/images/thumb/plot_cluster_comparison.png
   :target: ./cluster/plot_cluster_comparison.html

   :ref:`example_cluster_plot_cluster_comparison.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_cluster_comparison



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_mini_batch_kmeans.png
   :target: ./cluster/plot_mini_batch_kmeans.html

   :ref:`example_cluster_plot_mini_batch_kmeans.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_mini_batch_kmeans



.. raw:: html


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

.. figure:: cluster/images/thumb/plot_kmeans_silhouette_analysis.png
   :target: ./cluster/plot_kmeans_silhouette_analysis.html

   :ref:`example_cluster_plot_kmeans_silhouette_analysis.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cluster/plot_kmeans_silhouette_analysis


.. raw:: html

    <div class="clearer"></div>
    


.. _covariance_examples:

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

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





.. raw:: html


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

.. figure:: covariance/images/thumb/plot_lw_vs_oas.png
   :target: ./covariance/plot_lw_vs_oas.html

   :ref:`example_covariance_plot_lw_vs_oas.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   covariance/plot_lw_vs_oas



.. raw:: html


    <div class="thumbnailContainer" tooltip="When the amount of contamination is known, this example illustrates two different ways of perfo...">

.. figure:: covariance/images/thumb/plot_outlier_detection.png
   :target: ./covariance/plot_outlier_detection.html

   :ref:`example_covariance_plot_outlier_detection.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   covariance/plot_outlier_detection



.. raw:: html


    <div class="thumbnailContainer" tooltip="Using the GraphLasso estimator to learn a covariance and sparse precision from a small number o...">

.. figure:: covariance/images/thumb/plot_sparse_cov.png
   :target: ./covariance/plot_sparse_cov.html

   :ref:`example_covariance_plot_sparse_cov.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   covariance/plot_sparse_cov



.. raw:: html


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

.. figure:: covariance/images/thumb/plot_covariance_estimation.png
   :target: ./covariance/plot_covariance_estimation.html

   :ref:`example_covariance_plot_covariance_estimation.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   covariance/plot_covariance_estimation



.. raw:: html


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

.. figure:: covariance/images/thumb/plot_mahalanobis_distances.png
   :target: ./covariance/plot_mahalanobis_distances.html

   :ref:`example_covariance_plot_mahalanobis_distances.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   covariance/plot_mahalanobis_distances



.. raw:: html


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

.. figure:: covariance/images/thumb/plot_robust_vs_empirical_covariance.png
   :target: ./covariance/plot_robust_vs_empirical_covariance.html

   :ref:`example_covariance_plot_robust_vs_empirical_covariance.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   covariance/plot_robust_vs_empirical_covariance


.. raw:: html

    <div class="clearer"></div>
    


.. _cross_decomposition_examples:

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

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






.. raw:: html


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

.. figure:: cross_decomposition/images/thumb/plot_compare_cross_decomposition.png
   :target: ./cross_decomposition/plot_compare_cross_decomposition.html

   :ref:`example_cross_decomposition_plot_compare_cross_decomposition.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   cross_decomposition/plot_compare_cross_decomposition


.. raw:: html

    <div class="clearer"></div>
    


.. _dataset_examples:

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

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





.. raw:: html


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

.. figure:: datasets/images/thumb/plot_digits_last_image.png
   :target: ./datasets/plot_digits_last_image.html

   :ref:`example_datasets_plot_digits_last_image.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   datasets/plot_digits_last_image



.. raw:: html


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

.. figure:: datasets/images/thumb/plot_random_dataset.png
   :target: ./datasets/plot_random_dataset.html

   :ref:`example_datasets_plot_random_dataset.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   datasets/plot_random_dataset



.. raw:: html


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

.. figure:: datasets/images/thumb/plot_iris_dataset.png
   :target: ./datasets/plot_iris_dataset.html

   :ref:`example_datasets_plot_iris_dataset.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   datasets/plot_iris_dataset



.. raw:: html


    <div class="thumbnailContainer" tooltip="This illustrates the `datasets.make_multilabel_classification` dataset generator. Each sample c...">

.. figure:: datasets/images/thumb/plot_random_multilabel_dataset.png
   :target: ./datasets/plot_random_multilabel_dataset.html

   :ref:`example_datasets_plot_random_multilabel_dataset.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   datasets/plot_random_multilabel_dataset


.. raw:: html

    <div class="clearer"></div>
    


.. _decomposition_examples:

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

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






.. raw:: html


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

.. figure:: decomposition/images/thumb/plot_pca_vs_lda.png
   :target: ./decomposition/plot_pca_vs_lda.html

   :ref:`example_decomposition_plot_pca_vs_lda.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_pca_vs_lda



.. raw:: html


    <div class="thumbnailContainer" tooltip="=============== Incremental PCA ===============">

.. figure:: decomposition/images/thumb/plot_incremental_pca.png
   :target: ./decomposition/plot_incremental_pca.html

   :ref:`example_decomposition_plot_incremental_pca.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_incremental_pca



.. raw:: html


    <div class="thumbnailContainer" tooltip="Principal Component Analysis applied to the Iris dataset.">

.. figure:: decomposition/images/thumb/plot_pca_iris.png
   :target: ./decomposition/plot_pca_iris.html

   :ref:`example_decomposition_plot_pca_iris.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_pca_iris



.. raw:: html


    <div class="thumbnailContainer" tooltip="An example of estimating sources from noisy data.">

.. figure:: decomposition/images/thumb/plot_ica_blind_source_separation.png
   :target: ./decomposition/plot_ica_blind_source_separation.html

   :ref:`example_decomposition_plot_ica_blind_source_separation.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_ica_blind_source_separation



.. raw:: html


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

.. figure:: decomposition/images/thumb/plot_kernel_pca.png
   :target: ./decomposition/plot_kernel_pca.html

   :ref:`example_decomposition_plot_kernel_pca.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_kernel_pca



.. raw:: html


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

.. figure:: decomposition/images/thumb/plot_ica_vs_pca.png
   :target: ./decomposition/plot_ica_vs_pca.html

   :ref:`example_decomposition_plot_ica_vs_pca.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_ica_vs_pca



.. raw:: html


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

.. figure:: decomposition/images/thumb/plot_sparse_coding.png
   :target: ./decomposition/plot_sparse_coding.html

   :ref:`example_decomposition_plot_sparse_coding.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_sparse_coding



.. raw:: html


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

.. figure:: decomposition/images/thumb/plot_pca_3d.png
   :target: ./decomposition/plot_pca_3d.html

   :ref:`example_decomposition_plot_pca_3d.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_pca_3d



.. raw:: html


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

.. figure:: decomposition/images/thumb/plot_pca_vs_fa_model_selection.png
   :target: ./decomposition/plot_pca_vs_fa_model_selection.html

   :ref:`example_decomposition_plot_pca_vs_fa_model_selection.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_pca_vs_fa_model_selection



.. raw:: html


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

.. figure:: decomposition/images/thumb/plot_faces_decomposition.png
   :target: ./decomposition/plot_faces_decomposition.html

   :ref:`example_decomposition_plot_faces_decomposition.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_faces_decomposition



.. raw:: html


    <div class="thumbnailContainer" tooltip="An example comparing the effect of reconstructing noisy fragments of the Lena image using first...">

.. figure:: decomposition/images/thumb/plot_image_denoising.png
   :target: ./decomposition/plot_image_denoising.html

   :ref:`example_decomposition_plot_image_denoising.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   decomposition/plot_image_denoising


.. raw:: html

    <div class="clearer"></div>
    


.. _ensemble_examples:

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

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





.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_forest_importances_faces.png
   :target: ./ensemble/plot_forest_importances_faces.html

   :ref:`example_ensemble_plot_forest_importances_faces.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_forest_importances_faces



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_adaboost_regression.png
   :target: ./ensemble/plot_adaboost_regression.html

   :ref:`example_ensemble_plot_adaboost_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_adaboost_regression



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_forest_importances.png
   :target: ./ensemble/plot_forest_importances.html

   :ref:`example_ensemble_plot_forest_importances.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_forest_importances



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_gradient_boosting_regularization.png
   :target: ./ensemble/plot_gradient_boosting_regularization.html

   :ref:`example_ensemble_plot_gradient_boosting_regularization.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_gradient_boosting_regularization



.. raw:: html


    <div class="thumbnailContainer" tooltip="Partial dependence plots show the dependence between the target function [1]_ and a set of 'tar...">

.. figure:: ensemble/images/thumb/plot_partial_dependence.png
   :target: ./ensemble/plot_partial_dependence.html

   :ref:`example_ensemble_plot_partial_dependence.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_partial_dependence



.. raw:: html


    <div class="thumbnailContainer" tooltip="Demonstrate Gradient Boosting on the Boston housing dataset.">

.. figure:: ensemble/images/thumb/plot_gradient_boosting_regression.png
   :target: ./ensemble/plot_gradient_boosting_regression.html

   :ref:`example_ensemble_plot_gradient_boosting_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_gradient_boosting_regression



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_gradient_boosting_quantile.png
   :target: ./ensemble/plot_gradient_boosting_quantile.html

   :ref:`example_ensemble_plot_gradient_boosting_quantile.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_gradient_boosting_quantile



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_random_forest_embedding.png
   :target: ./ensemble/plot_random_forest_embedding.html

   :ref:`example_ensemble_plot_random_forest_embedding.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_random_forest_embedding



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_adaboost_twoclass.png
   :target: ./ensemble/plot_adaboost_twoclass.html

   :ref:`example_ensemble_plot_adaboost_twoclass.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_adaboost_twoclass



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_adaboost_hastie_10_2.png
   :target: ./ensemble/plot_adaboost_hastie_10_2.html

   :ref:`example_ensemble_plot_adaboost_hastie_10_2.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_adaboost_hastie_10_2



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction...">

.. figure:: ensemble/images/thumb/plot_adaboost_multiclass.png
   :target: ./ensemble/plot_adaboost_multiclass.html

   :ref:`example_ensemble_plot_adaboost_multiclass.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_adaboost_multiclass



.. raw:: html


    <div class="thumbnailContainer" tooltip="Out-of-bag (OOB) estimates can be a useful heuristic to estimate the "optimal" number of boosti...">

.. figure:: ensemble/images/thumb/plot_gradient_boosting_oob.png
   :target: ./ensemble/plot_gradient_boosting_oob.html

   :ref:`example_ensemble_plot_gradient_boosting_oob.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_gradient_boosting_oob



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_forest_iris.png
   :target: ./ensemble/plot_forest_iris.html

   :ref:`example_ensemble_plot_forest_iris.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_forest_iris



.. raw:: html


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

.. figure:: ensemble/images/thumb/plot_bias_variance.png
   :target: ./ensemble/plot_bias_variance.html

   :ref:`example_ensemble_plot_bias_variance.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   ensemble/plot_bias_variance


.. raw:: html

    <div class="clearer"></div>
    


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

Exercises for the tutorials





.. raw:: html


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

.. figure:: exercises/images/thumb/digits_classification_exercise.png
   :target: ./exercises/digits_classification_exercise.html

   :ref:`example_exercises_digits_classification_exercise.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   exercises/digits_classification_exercise



.. raw:: html


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

.. figure:: exercises/images/thumb/plot_cv_digits.png
   :target: ./exercises/plot_cv_digits.html

   :ref:`example_exercises_plot_cv_digits.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   exercises/plot_cv_digits



.. raw:: html


    <div class="thumbnailContainer" tooltip="A tutorial exercise for using different SVM kernels.">

.. figure:: exercises/images/thumb/plot_iris_exercise.png
   :target: ./exercises/plot_iris_exercise.html

   :ref:`example_exercises_plot_iris_exercise.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   exercises/plot_iris_exercise



.. raw:: html


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

.. figure:: exercises/images/thumb/plot_cv_diabetes.png
   :target: ./exercises/plot_cv_diabetes.html

   :ref:`example_exercises_plot_cv_diabetes.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   exercises/plot_cv_diabetes


.. raw:: html

    <div class="clearer"></div>
    


.. _feature_selection_examples:

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

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





.. raw:: html


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

.. figure:: feature_selection/images/thumb/feature_selection_pipeline.png
   :target: ./feature_selection/feature_selection_pipeline.html

   :ref:`example_feature_selection_feature_selection_pipeline.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   feature_selection/feature_selection_pipeline



.. raw:: html


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

.. figure:: feature_selection/images/thumb/plot_rfe_digits.png
   :target: ./feature_selection/plot_rfe_digits.html

   :ref:`example_feature_selection_plot_rfe_digits.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   feature_selection/plot_rfe_digits



.. raw:: html


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

.. figure:: feature_selection/images/thumb/plot_rfe_with_cross_validation.png
   :target: ./feature_selection/plot_rfe_with_cross_validation.html

   :ref:`example_feature_selection_plot_rfe_with_cross_validation.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   feature_selection/plot_rfe_with_cross_validation



.. raw:: html


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

.. figure:: feature_selection/images/thumb/plot_permutation_test_for_classification.png
   :target: ./feature_selection/plot_permutation_test_for_classification.html

   :ref:`example_feature_selection_plot_permutation_test_for_classification.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   feature_selection/plot_permutation_test_for_classification



.. raw:: html


    <div class="thumbnailContainer" tooltip="An example showing univariate feature selection.">

.. figure:: feature_selection/images/thumb/plot_feature_selection.png
   :target: ./feature_selection/plot_feature_selection.html

   :ref:`example_feature_selection_plot_feature_selection.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   feature_selection/plot_feature_selection


.. raw:: html

    <div class="clearer"></div>
    


.. _gaussian_process_examples:

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

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






.. raw:: html


    <div class="thumbnailContainer" tooltip="In this example, we fit a Gaussian Process model onto the diabetes dataset.">

.. figure:: gaussian_process/images/thumb/gp_diabetes_dataset.png
   :target: ./gaussian_process/gp_diabetes_dataset.html

   :ref:`example_gaussian_process_gp_diabetes_dataset.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   gaussian_process/gp_diabetes_dataset



.. raw:: html


    <div class="thumbnailContainer" tooltip="A two-dimensional regression exercise with a post-processing allowing for probabilistic classif...">

.. figure:: gaussian_process/images/thumb/plot_gp_probabilistic_classification_after_regression.png
   :target: ./gaussian_process/plot_gp_probabilistic_classification_after_regression.html

   :ref:`example_gaussian_process_plot_gp_probabilistic_classification_after_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   gaussian_process/plot_gp_probabilistic_classification_after_regression



.. raw:: html


    <div class="thumbnailContainer" tooltip="A simple one-dimensional regression exercise computed in two different ways:">

.. figure:: gaussian_process/images/thumb/plot_gp_regression.png
   :target: ./gaussian_process/plot_gp_regression.html

   :ref:`example_gaussian_process_plot_gp_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   gaussian_process/plot_gp_regression


.. raw:: html

    <div class="clearer"></div>
    


.. _linear_examples:

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

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





.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_lasso_lars.png
   :target: ./linear_model/plot_lasso_lars.html

   :ref:`example_linear_model_plot_lasso_lars.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_lasso_lars



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_sgd_loss_functions.png
   :target: ./linear_model/plot_sgd_loss_functions.html

   :ref:`example_linear_model_plot_sgd_loss_functions.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_sgd_loss_functions



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_sgd_separating_hyperplane.png
   :target: ./linear_model/plot_sgd_separating_hyperplane.html

   :ref:`example_linear_model_plot_sgd_separating_hyperplane.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_sgd_separating_hyperplane



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_sgd_weighted_samples.png
   :target: ./linear_model/plot_sgd_weighted_samples.html

   :ref:`example_linear_model_plot_sgd_weighted_samples.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_sgd_weighted_samples



.. raw:: html


    <div class="thumbnailContainer" tooltip="Shows the effect of collinearity in the coefficients of an estimator.">

.. figure:: linear_model/images/thumb/plot_ridge_path.png
   :target: ./linear_model/plot_ridge_path.html

   :ref:`example_linear_model_plot_ridge_path.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_ridge_path



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_ransac.png
   :target: ./linear_model/plot_ransac.html

   :ref:`example_linear_model_plot_ransac.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_ransac



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_polynomial_interpolation.png
   :target: ./linear_model/plot_polynomial_interpolation.html

   :ref:`example_linear_model_plot_polynomial_interpolation.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_polynomial_interpolation



.. raw:: html


    <div class="thumbnailContainer" tooltip="Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wik...">

.. figure:: linear_model/images/thumb/plot_iris_logistic.png
   :target: ./linear_model/plot_iris_logistic.html

   :ref:`example_linear_model_plot_iris_logistic.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_iris_logistic



.. raw:: html


    <div class="thumbnailContainer" tooltip="Computes path on IRIS dataset.">

.. figure:: linear_model/images/thumb/plot_logistic_path.png
   :target: ./linear_model/plot_logistic_path.html

   :ref:`example_linear_model_plot_logistic_path.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_logistic_path



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_sgd_comparison.png
   :target: ./linear_model/plot_sgd_comparison.html

   :ref:`example_linear_model_plot_sgd_comparison.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_sgd_comparison



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_ols_ridge_variance.png
   :target: ./linear_model/plot_ols_ridge_variance.html

   :ref:`example_linear_model_plot_ols_ridge_variance.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_ols_ridge_variance



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_ols.png
   :target: ./linear_model/plot_ols.html

   :ref:`example_linear_model_plot_ols.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_ols



.. raw:: html


    <div class="thumbnailContainer" tooltip="Show in the plot is how the logistic regression would, in this synthetic dataset, classify valu...">

.. figure:: linear_model/images/thumb/plot_logistic.png
   :target: ./linear_model/plot_logistic.html

   :ref:`example_linear_model_plot_logistic.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_logistic



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_multi_task_lasso_support.png
   :target: ./linear_model/plot_multi_task_lasso_support.html

   :ref:`example_linear_model_plot_multi_task_lasso_support.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_multi_task_lasso_support



.. raw:: html


    <div class="thumbnailContainer" tooltip="Plot the contours of the three penalties.">

.. figure:: linear_model/images/thumb/plot_sgd_penalties.png
   :target: ./linear_model/plot_sgd_penalties.html

   :ref:`example_linear_model_plot_sgd_penalties.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_sgd_penalties



.. raw:: html


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

.. figure:: linear_model/images/thumb/lasso_dense_vs_sparse_data.png
   :target: ./linear_model/lasso_dense_vs_sparse_data.html

   :ref:`example_linear_model_lasso_dense_vs_sparse_data.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/lasso_dense_vs_sparse_data



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_lasso_and_elasticnet.png
   :target: ./linear_model/plot_lasso_and_elasticnet.html

   :ref:`example_linear_model_plot_lasso_and_elasticnet.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_lasso_and_elasticnet



.. raw:: html


    <div class="thumbnailContainer" tooltip="Computes a Bayesian Ridge Regression on a synthetic dataset.">

.. figure:: linear_model/images/thumb/plot_bayesian_ridge.png
   :target: ./linear_model/plot_bayesian_ridge.html

   :ref:`example_linear_model_plot_bayesian_ridge.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_bayesian_ridge



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_ols_3d.png
   :target: ./linear_model/plot_ols_3d.html

   :ref:`example_linear_model_plot_ols_3d.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_ols_3d



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_robust_fit.png
   :target: ./linear_model/plot_robust_fit.html

   :ref:`example_linear_model_plot_robust_fit.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_robust_fit



.. raw:: html


    <div class="thumbnailContainer" tooltip="Fit regression model with Bayesian Ridge Regression.">

.. figure:: linear_model/images/thumb/plot_ard.png
   :target: ./linear_model/plot_ard.html

   :ref:`example_linear_model_plot_ard.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_ard



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_logistic_l1_l2_sparsity.png
   :target: ./linear_model/plot_logistic_l1_l2_sparsity.html

   :ref:`example_linear_model_plot_logistic_l1_l2_sparsity.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_logistic_l1_l2_sparsity



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_sgd_iris.png
   :target: ./linear_model/plot_sgd_iris.html

   :ref:`example_linear_model_plot_sgd_iris.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_sgd_iris



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_theilsen.png
   :target: ./linear_model/plot_theilsen.html

   :ref:`example_linear_model_plot_theilsen.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_theilsen



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_omp.png
   :target: ./linear_model/plot_omp.html

   :ref:`example_linear_model_plot_omp.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_omp



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_lasso_coordinate_descent_path.png
   :target: ./linear_model/plot_lasso_coordinate_descent_path.html

   :ref:`example_linear_model_plot_lasso_coordinate_descent_path.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_lasso_coordinate_descent_path



.. raw:: html


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

.. figure:: linear_model/images/thumb/plot_lasso_model_selection.png
   :target: ./linear_model/plot_lasso_model_selection.html

   :ref:`example_linear_model_plot_lasso_model_selection.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_lasso_model_selection



.. raw:: html


    <div class="thumbnailContainer" tooltip="Given a small number of observations, we want to recover which features of X are relevant to ex...">

.. figure:: linear_model/images/thumb/plot_sparse_recovery.png
   :target: ./linear_model/plot_sparse_recovery.html

   :ref:`example_linear_model_plot_sparse_recovery.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   linear_model/plot_sparse_recovery


.. raw:: html

    <div class="clearer"></div>
    


.. _manifold_examples:

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

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






.. raw:: html


    <div class="thumbnailContainer" tooltip="An illustration of Swiss Roll reduction with locally linear embedding ">

.. figure:: manifold/images/thumb/plot_swissroll.png
   :target: ./manifold/plot_swissroll.html

   :ref:`example_manifold_plot_swissroll.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   manifold/plot_swissroll



.. raw:: html


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

.. figure:: manifold/images/thumb/plot_mds.png
   :target: ./manifold/plot_mds.html

   :ref:`example_manifold_plot_mds.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   manifold/plot_mds



.. raw:: html


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

.. figure:: manifold/images/thumb/plot_compare_methods.png
   :target: ./manifold/plot_compare_methods.html

   :ref:`example_manifold_plot_compare_methods.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   manifold/plot_compare_methods



.. raw:: html


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

.. figure:: manifold/images/thumb/plot_manifold_sphere.png
   :target: ./manifold/plot_manifold_sphere.html

   :ref:`example_manifold_plot_manifold_sphere.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   manifold/plot_manifold_sphere



.. raw:: html


    <div class="thumbnailContainer" tooltip="An illustration of various embeddings on the digits dataset.">

.. figure:: manifold/images/thumb/plot_lle_digits.png
   :target: ./manifold/plot_lle_digits.html

   :ref:`example_manifold_plot_lle_digits.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   manifold/plot_lle_digits


.. raw:: html

    <div class="clearer"></div>
    


.. _mixture_examples:

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

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





.. raw:: html


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

.. figure:: mixture/images/thumb/plot_gmm_pdf.png
   :target: ./mixture/plot_gmm_pdf.html

   :ref:`example_mixture_plot_gmm_pdf.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   mixture/plot_gmm_pdf



.. raw:: html


    <div class="thumbnailContainer" tooltip="Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet ...">

.. figure:: mixture/images/thumb/plot_gmm.png
   :target: ./mixture/plot_gmm.html

   :ref:`example_mixture_plot_gmm.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   mixture/plot_gmm



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example highlights the advantages of the Dirichlet Process: complexity control and dealing...">

.. figure:: mixture/images/thumb/plot_gmm_sin.png
   :target: ./mixture/plot_gmm_sin.html

   :ref:`example_mixture_plot_gmm_sin.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   mixture/plot_gmm_sin



.. raw:: html


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

.. figure:: mixture/images/thumb/plot_gmm_selection.png
   :target: ./mixture/plot_gmm_selection.html

   :ref:`example_mixture_plot_gmm_selection.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   mixture/plot_gmm_selection



.. raw:: html


    <div class="thumbnailContainer" tooltip="Demonstration of Gaussian mixture models for classification.">

.. figure:: mixture/images/thumb/plot_gmm_classifier.png
   :target: ./mixture/plot_gmm_classifier.html

   :ref:`example_mixture_plot_gmm_classifier.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   mixture/plot_gmm_classifier


.. raw:: html

    <div class="clearer"></div>
    


.. _model_selection_examples:

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

Examples concerning model selection, mostly contained in the
:mod:`sklearn.grid_search` and :mod:`sklearn.cross_validation` modules.





.. raw:: html


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

.. figure:: model_selection/images/thumb/plot_validation_curve.png
   :target: ./model_selection/plot_validation_curve.html

   :ref:`example_model_selection_plot_validation_curve.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/plot_validation_curve



.. raw:: html


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

.. figure:: model_selection/images/thumb/plot_underfitting_overfitting.png
   :target: ./model_selection/plot_underfitting_overfitting.html

   :ref:`example_model_selection_plot_underfitting_overfitting.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/plot_underfitting_overfitting



.. raw:: html


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

.. figure:: model_selection/images/thumb/plot_confusion_matrix.png
   :target: ./model_selection/plot_confusion_matrix.html

   :ref:`example_model_selection_plot_confusion_matrix.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/plot_confusion_matrix



.. raw:: html


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

.. figure:: model_selection/images/thumb/plot_roc_crossval.png
   :target: ./model_selection/plot_roc_crossval.html

   :ref:`example_model_selection_plot_roc_crossval.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/plot_roc_crossval



.. raw:: html


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

.. figure:: model_selection/images/thumb/grid_search_digits.png
   :target: ./model_selection/grid_search_digits.html

   :ref:`example_model_selection_grid_search_digits.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/grid_search_digits



.. raw:: html


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

.. figure:: model_selection/images/thumb/plot_train_error_vs_test_error.png
   :target: ./model_selection/plot_train_error_vs_test_error.html

   :ref:`example_model_selection_plot_train_error_vs_test_error.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/plot_train_error_vs_test_error



.. raw:: html


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

.. figure:: model_selection/images/thumb/randomized_search.png
   :target: ./model_selection/randomized_search.html

   :ref:`example_model_selection_randomized_search.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/randomized_search



.. raw:: html


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

.. figure:: model_selection/images/thumb/plot_roc.png
   :target: ./model_selection/plot_roc.html

   :ref:`example_model_selection_plot_roc.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/plot_roc



.. raw:: html


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

.. figure:: model_selection/images/thumb/plot_precision_recall.png
   :target: ./model_selection/plot_precision_recall.html

   :ref:`example_model_selection_plot_precision_recall.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/plot_precision_recall



.. raw:: html


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

.. figure:: model_selection/images/thumb/grid_search_text_feature_extraction.png
   :target: ./model_selection/grid_search_text_feature_extraction.html

   :ref:`example_model_selection_grid_search_text_feature_extraction.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/grid_search_text_feature_extraction



.. raw:: html


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

.. figure:: model_selection/images/thumb/plot_learning_curve.png
   :target: ./model_selection/plot_learning_curve.html

   :ref:`example_model_selection_plot_learning_curve.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   model_selection/plot_learning_curve


.. raw:: html

    <div class="clearer"></div>
    


.. _neighbors_examples:

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

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





.. raw:: html


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

.. figure:: neighbors/images/thumb/plot_regression.png
   :target: ./neighbors/plot_regression.html

   :ref:`example_neighbors_plot_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neighbors/plot_regression



.. raw:: html


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

.. figure:: neighbors/images/thumb/plot_classification.png
   :target: ./neighbors/plot_classification.html

   :ref:`example_neighbors_plot_classification.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neighbors/plot_classification



.. raw:: html


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

.. figure:: neighbors/images/thumb/plot_nearest_centroid.png
   :target: ./neighbors/plot_nearest_centroid.html

   :ref:`example_neighbors_plot_nearest_centroid.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neighbors/plot_nearest_centroid



.. raw:: html


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

.. figure:: neighbors/images/thumb/plot_digits_kde_sampling.png
   :target: ./neighbors/plot_digits_kde_sampling.html

   :ref:`example_neighbors_plot_digits_kde_sampling.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neighbors/plot_digits_kde_sampling



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example does not perform any learning over the data (see :ref:`example_applications_plot_s...">

.. figure:: neighbors/images/thumb/plot_species_kde.png
   :target: ./neighbors/plot_species_kde.html

   :ref:`example_neighbors_plot_species_kde.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neighbors/plot_species_kde



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example demonstrates the behaviour of the accuracy of the nearest neighbor queries of Loca...">

.. figure:: neighbors/images/thumb/plot_approximate_nearest_neighbors_hyperparameters.png
   :target: ./neighbors/plot_approximate_nearest_neighbors_hyperparameters.html

   :ref:`example_neighbors_plot_approximate_nearest_neighbors_hyperparameters.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neighbors/plot_approximate_nearest_neighbors_hyperparameters



.. raw:: html


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

.. figure:: neighbors/images/thumb/plot_kde_1d.png
   :target: ./neighbors/plot_kde_1d.html

   :ref:`example_neighbors_plot_kde_1d.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neighbors/plot_kde_1d



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example studies the scalability profile of approximate 10-neighbors queries using the LSHF...">

.. figure:: neighbors/images/thumb/plot_approximate_nearest_neighbors_scalability.png
   :target: ./neighbors/plot_approximate_nearest_neighbors_scalability.html

   :ref:`example_neighbors_plot_approximate_nearest_neighbors_scalability.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neighbors/plot_approximate_nearest_neighbors_scalability


.. raw:: html

    <div class="clearer"></div>
    


.. _neural_network_examples:

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

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





.. raw:: html


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

.. figure:: neural_networks/images/thumb/plot_rbm_logistic_classification.png
   :target: ./neural_networks/plot_rbm_logistic_classification.html

   :ref:`example_neural_networks_plot_rbm_logistic_classification.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   neural_networks/plot_rbm_logistic_classification


.. raw:: html

    <div class="clearer"></div>
    


.. _semi_supervised_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer" tooltip="Example of LabelPropagation learning a complex internal structure to demonstrate "manifold lear...">

.. figure:: semi_supervised/images/thumb/plot_label_propagation_structure.png
   :target: ./semi_supervised/plot_label_propagation_structure.html

   :ref:`example_semi_supervised_plot_label_propagation_structure.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   semi_supervised/plot_label_propagation_structure



.. raw:: html


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

.. figure:: semi_supervised/images/thumb/plot_label_propagation_versus_svm_iris.png
   :target: ./semi_supervised/plot_label_propagation_versus_svm_iris.html

   :ref:`example_semi_supervised_plot_label_propagation_versus_svm_iris.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   semi_supervised/plot_label_propagation_versus_svm_iris



.. raw:: html


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

.. figure:: semi_supervised/images/thumb/plot_label_propagation_digits.png
   :target: ./semi_supervised/plot_label_propagation_digits.html

   :ref:`example_semi_supervised_plot_label_propagation_digits.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   semi_supervised/plot_label_propagation_digits



.. raw:: html


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

.. figure:: semi_supervised/images/thumb/plot_label_propagation_digits_active_learning.png
   :target: ./semi_supervised/plot_label_propagation_digits_active_learning.html

   :ref:`example_semi_supervised_plot_label_propagation_digits_active_learning.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   semi_supervised/plot_label_propagation_digits_active_learning


.. raw:: html

    <div class="clearer"></div>
    


.. _svm_examples:

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

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





.. raw:: html


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

.. figure:: svm/images/thumb/plot_svm_nonlinear.png
   :target: ./svm/plot_svm_nonlinear.html

   :ref:`example_svm_plot_svm_nonlinear.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_svm_nonlinear



.. raw:: html


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

.. figure:: svm/images/thumb/plot_svm_regression.png
   :target: ./svm/plot_svm_regression.html

   :ref:`example_svm_plot_svm_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_svm_regression



.. raw:: html


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

.. figure:: svm/images/thumb/plot_separating_hyperplane.png
   :target: ./svm/plot_separating_hyperplane.html

   :ref:`example_svm_plot_separating_hyperplane.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_separating_hyperplane



.. raw:: html


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

.. figure:: svm/images/thumb/plot_separating_hyperplane_unbalanced.png
   :target: ./svm/plot_separating_hyperplane_unbalanced.html

   :ref:`example_svm_plot_separating_hyperplane_unbalanced.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_separating_hyperplane_unbalanced



.. raw:: html


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

.. figure:: svm/images/thumb/plot_custom_kernel.png
   :target: ./svm/plot_custom_kernel.html

   :ref:`example_svm_plot_custom_kernel.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_custom_kernel



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example shows how to perform univariate feature before running a SVC (support vector class...">

.. figure:: svm/images/thumb/plot_svm_anova.png
   :target: ./svm/plot_svm_anova.html

   :ref:`example_svm_plot_svm_anova.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_svm_anova



.. raw:: html


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

.. figure:: svm/images/thumb/plot_weighted_samples.png
   :target: ./svm/plot_weighted_samples.html

   :ref:`example_svm_plot_weighted_samples.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_weighted_samples



.. raw:: html


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

.. figure:: svm/images/thumb/plot_oneclass.png
   :target: ./svm/plot_oneclass.html

   :ref:`example_svm_plot_oneclass.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_oneclass



.. raw:: html


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

.. figure:: svm/images/thumb/plot_iris.png
   :target: ./svm/plot_iris.html

   :ref:`example_svm_plot_iris.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_iris



.. raw:: html


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

.. figure:: svm/images/thumb/plot_svm_kernels.png
   :target: ./svm/plot_svm_kernels.html

   :ref:`example_svm_plot_svm_kernels.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_svm_kernels



.. raw:: html


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

.. figure:: svm/images/thumb/plot_svm_margin.png
   :target: ./svm/plot_svm_margin.html

   :ref:`example_svm_plot_svm_margin.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_svm_margin



.. raw:: html


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

.. figure:: svm/images/thumb/plot_svm_scale_c.png
   :target: ./svm/plot_svm_scale_c.html

   :ref:`example_svm_plot_svm_scale_c.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_svm_scale_c



.. raw:: html


    <div class="thumbnailContainer" tooltip="This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radius Basis F...">

.. figure:: svm/images/thumb/plot_rbf_parameters.png
   :target: ./svm/plot_rbf_parameters.html

   :ref:`example_svm_plot_rbf_parameters.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   svm/plot_rbf_parameters


.. raw:: html

    <div class="clearer"></div>
    


.. _text_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer" tooltip="Compares FeatureHasher and DictVectorizer by using both to vectorize text documents.">

.. figure:: text/images/thumb/hashing_vs_dict_vectorizer.png
   :target: ./text/hashing_vs_dict_vectorizer.html

   :ref:`example_text_hashing_vs_dict_vectorizer.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   text/hashing_vs_dict_vectorizer



.. raw:: html


    <div class="thumbnailContainer" tooltip="This is an example showing how the scikit-learn can be used to classify documents by topics usi...">

.. figure:: text/images/thumb/mlcomp_sparse_document_classification.png
   :target: ./text/mlcomp_sparse_document_classification.html

   :ref:`example_text_mlcomp_sparse_document_classification.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   text/mlcomp_sparse_document_classification



.. raw:: html


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

.. figure:: text/images/thumb/document_clustering.png
   :target: ./text/document_clustering.html

   :ref:`example_text_document_clustering.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   text/document_clustering



.. raw:: html


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

.. figure:: text/images/thumb/document_classification_20newsgroups.png
   :target: ./text/document_classification_20newsgroups.html

   :ref:`example_text_document_classification_20newsgroups.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   text/document_classification_20newsgroups


.. raw:: html

    <div class="clearer"></div>
    


.. _tree_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer" tooltip="A 1D regression with decision tree.">

.. figure:: tree/images/thumb/plot_tree_regression.png
   :target: ./tree/plot_tree_regression.html

   :ref:`example_tree_plot_tree_regression.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   tree/plot_tree_regression



.. raw:: html


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

.. figure:: tree/images/thumb/plot_tree_regression_multioutput.png
   :target: ./tree/plot_tree_regression_multioutput.html

   :ref:`example_tree_plot_tree_regression_multioutput.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   tree/plot_tree_regression_multioutput



.. raw:: html


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

.. figure:: tree/images/thumb/plot_iris.png
   :target: ./tree/plot_iris.html

   :ref:`example_tree_plot_iris.py`


.. raw:: html

    </div>



.. toctree::
   :hidden:

   tree/plot_iris


.. raw:: html

    <div class="clearer"></div>