


.. raw:: html


    <style type="text/css">

    div#sidebarbutton {
        display: none;
    }

    .figure {
        float: left;
        margin: 10px;
        -webkit-border-radius: 10px; /* Saf3-4, iOS 1-3.2, Android <1.6 */
        -moz-border-radius: 10px; /* FF1-3.6 */
        border-radius: 10px; /* Opera 10.5, IE9, Saf5, Chrome, FF4, iOS 4, Android 2.1+ */
        border: 2px solid #fff;
        background-color: white;
        /* --> Thumbnail image size */
        width: 150px;
        height: 100px;
        -webkit-background-size: 150px 100px; /* Saf3-4 */
        -moz-background-size: 150px 100px; /* FF3.6 */
    }

    .figure img {
        display: inline;
    }

    div.docstringWrapper p.caption {
        display: block;
        -webkit-box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.0);
        -moz-box-shadow: 0px 0px 20px rgba(0, 0, 0, .0); /* FF3.5 - 3.6 */
        box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.0); /* Opera 10.5, IE9, FF4+, Chrome 10+ */
        padding: 0px;
        border: white;
    }

    div.docstringWrapper p {
        display: none;
        background-color: white;
        -webkit-box-shadow: 0px 0px 20px rgba(0, 0, 0, 1.00);
        -moz-box-shadow: 0px 0px 20px rgba(0, 0, 0, 1.00); /* FF3.5 - 3.6 */
        box-shadow: 0px 0px 20px rgba(0, 0, 0, 1.00); /* Opera 10.5, IE9, FF4+, Chrome 10+ */
        padding: 13px;
        margin-top: 0px;
        border-style: solid;
        border-width: 1px;
    }


    </style>


.. raw:: html


        <script type="text/javascript">

        function animateClone(e){
          var position;
          position = $(this).position();
          var clone = $(this).closest('.thumbnailContainer').find('.clonedItem');
          var clone_fig = clone.find('.figure');
          clone.css("left", position.left - 70).css("top", position.top - 70).css("position", "absolute").css("z-index", 1000).css("background-color", "white");

          var cloneImg = clone_fig.find('img');

          clone.show();
          clone.animate({
                height: "270px",
                width: "320px"
            }, 0
          );
          cloneImg.css({
                'max-height': "200px",
                'max-width': "280px"
          });
          cloneImg.animate({
                height: "200px",
                width: "280px"
            }, 0
           );
          clone_fig.css({
               'margin-top': '20px',
          });
          clone_fig.show();
          clone.find('p').css("display", "block");
          clone_fig.css({
               height: "240",
               width: "305px"
          });
          cloneP_height = clone.find('p.caption').height();
          clone_fig.animate({
               height: (200 + cloneP_height)
           }, 0
          );

          clone.bind("mouseleave", function(e){
              clone.animate({
                  height: "100px",
                  width: "150px"
              }, 10, function(){$(this).hide();});
              clone_fig.animate({
                  height: "100px",
                  width: "150px"
              }, 10, function(){$(this).hide();});
          });
        } //end animateClone()


        $(window).load(function () {
            $(".figure").css("z-index", 1);

            $(".docstringWrapper").each(function(i, obj){
                var clone;
                var $obj = $(obj);
                clone = $obj.clone();
                clone.addClass("clonedItem");
                clone.appendTo($obj.closest(".thumbnailContainer"));
                clone.hide();
                $obj.bind("mouseenter", animateClone);
            }); // end each
        }); // end

        </script>



Examples
========

.. _examples-index:



.. _general_examples:

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

General-purpose and introductory examples for the scikit.





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_feature_selection_pipeline.py`


.. raw:: html


    <p>Simple usage of Pipeline that runs successively a univariate feature selection with anova and t...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./feature_selection_pipeline



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_rfe_digits.py`


.. raw:: html


    <p>A recursive feature elimination example showing the relevance of pixels in a digit classificati...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_rfe_digits



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_rfe_with_cross_validation.py`


.. raw:: html


    <p>A recursive feature elimination example with automatic tuning of the number of features selecte...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_rfe_with_cross_validation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_confusion_matrix.py`


.. raw:: html


    <p>Example of confusion matrix usage to evaluate the quality of the output of a classifier on the ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_confusion_matrix



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_validation_curve.py`


.. raw:: html


    <p>In this plot you can see the training scores and validation scores of an SVM for different valu...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_validation_curve



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_underfitting_overfitting.py`


.. raw:: html


    <p>This example demonstrates the problems of underfitting and overfitting and how we can use linea...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_underfitting_overfitting



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_feature_stacker.py`


.. raw:: html


    <p>In many real-world examples, there are many ways to extract features from a dataset. Often it i...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./feature_stacker



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_isotonic_regression.py`


.. raw:: html


    <p>An illustration of the isotonic regression on generated data. The isotonic regression finds a n...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_isotonic_regression



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_imputation.py`


.. raw:: html


    <p>This example shows that imputing the missing values can give better results than discarding the...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./imputation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_digits_pipe.py`


.. raw:: html


    <p>The PCA does an unsupervised dimensionality reduction, while the logistic regression does the p...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_digits_pipe



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_digits_classification.py`


.. raw:: html


    <p>An example showing how the scikit-learn can be used to recognize images of hand-written digits.
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_digits_classification



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_permutation_test_for_classification.py`


.. raw:: html


    <p>In order to test if a classification score is significative a technique in repeating the classi...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_permutation_test_for_classification



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_grid_search_digits.py`


.. raw:: html


    <p>This examples shows how a classifier is optimized by cross-validation, which is done using the ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./grid_search_digits



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_roc_crossval.py`


.. raw:: html


    <p>Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_roc_crossval



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_train_error_vs_test_error.py`


.. raw:: html


    <p>Illustration of how the performance of an estimator on unseen data (test data) is not the same ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_train_error_vs_test_error



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_feature_selection.py`


.. raw:: html


    <p>An example showing univariate feature selection.
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_feature_selection



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_classification_probability.py`


.. raw:: html


    <p>Plot the classification probability for different classifiers. We use a 3 class dataset, and we...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_classification_probability



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_randomized_search.py`


.. raw:: html


    <p>Compare randomized search and grid search for optimizing hyperparameters of a random forest. Al...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./randomized_search



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_roc.py`


.. raw:: html


    <p>Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_roc



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_precision_recall.py`


.. raw:: html


    <p>Example of Precision-Recall metric to evaluate classifier output quality.
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_precision_recall



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_multilabel.py`


.. raw:: html


    <p>This example simulates a multi-label document classification problem. The dataset is generated ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_multilabel



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_multioutput_face_completion.py`


.. raw:: html


    <p>This example shows the use of multi-output estimator to complete images. The goal is to predict...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_multioutput_face_completion



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_grid_search_text_feature_extraction.py`


.. raw:: html


    <p>The dataset used in this example is the 20 newsgroups dataset which will be automatically downl...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./grid_search_text_feature_extraction



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_learning_curve.py`


.. raw:: html


    <p>On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_learning_curve



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_hashing_vs_dict_vectorizer.py`


.. raw:: html


    <p>Compares FeatureHasher and DictVectorizer by using both to vectorize text documents.
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./hashing_vs_dict_vectorizer



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_johnson_lindenstrauss_bound.py`


.. raw:: html


    <p> The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly pr...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_johnson_lindenstrauss_bound



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_classifier_comparison.py`


.. raw:: html


    <p>A comparison of a several classifiers in scikit-learn on synthetic datasets. The point of this ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_classifier_comparison



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_rbm_logistic_classification.py`


.. raw:: html


    <p>For greyscale image data where pixel values can be interpreted as degrees of blackness on a whi...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_rbm_logistic_classification



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_lda_qda.py`


.. raw:: html


    <p>Plot the confidence ellipsoids of each class and decision boundary 
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_lda_qda



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_document_clustering.py`


.. raw:: html


    <p>This is an example showing how the scikit-learn can be used to cluster documents by topics usin...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./document_clustering



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_plot_kernel_approximation.py`


.. raw:: html


    <p>An example illustrating the approximation of the feature map of an RBF kernel.
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./plot_kernel_approximation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_document_classification_20newsgroups.py`


.. raw:: html


    <p>This is an example showing how scikit-learn can be used to classify documents by topics using a...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ./document_classification_20newsgroups


.. 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="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This is a proof of concept application of Non Negative Matrix Factorization of the term frequen...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/topics_extraction_with_nmf



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example illustrates the need for robust covariance estimation on a real data set. It is us...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/plot_outlier_detection_housing



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example shows the reconstruction of an image from a set of parallel projections, acquired ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/plot_tomography_l1_reconstruction



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_applications_face_recognition.py`


.. raw:: html


    <p>The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/face_recognition



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Demonstrate how model complexity influences both prediction accuracy and computational performa...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/plot_model_complexity_influence



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Modeling species' geographic distributions is an important problem in conservation biology. In ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/plot_species_distribution_modeling



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_applications_plot_stock_market.py`


.. raw:: html


    <p>This example employs several unsupervised learning techniques to extract the stock market struc...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/plot_stock_market



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_applications_wikipedia_principal_eigenvector.py`


.. raw:: html


    <p>A classical way to assert the relative importance of vertices in a graph is to compute the prin...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/wikipedia_principal_eigenvector



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_applications_plot_prediction_latency.py`


.. raw:: html


    <p>This is an example showing the prediction latency of various scikit-learn estimators.
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/plot_prediction_latency



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_applications_svm_gui.py`


.. raw:: html


    <p>A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create da...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/svm_gui



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This is an example showing how scikit-learn can be used for classification using an out-of-core...
    </p></div>
    </div>


.. toctree::
   :hidden:

   applications/plot_out_of_core_classification


.. raw:: html

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


.. _bicluster_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_bicluster_plot_spectral_coclustering.py`


.. raw:: html


    <p>This example demonstrates how to generate a dataset and bicluster it using the the Spectral Co-...
    </p></div>
    </div>


.. toctree::
   :hidden:

   bicluster/plot_spectral_coclustering



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_bicluster_plot_spectral_biclustering.py`


.. raw:: html


    <p>This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spe...
    </p></div>
    </div>


.. toctree::
   :hidden:

   bicluster/plot_spectral_biclustering



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_bicluster_bicluster_newsgroups.py`


.. raw:: html


    <p>This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset...
    </p></div>
    </div>


.. toctree::
   :hidden:

   bicluster/bicluster_newsgroups


.. raw:: html

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


.. _cluster_examples:

Clustering
----------

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_mean_shift.py`


.. raw:: html


    <p>Reference:
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_mean_shift



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spa...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_lena_ward_segmentation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_digits_agglomeration.py`


.. raw:: html


    <p>These images how similar features are merged together using feature agglomeration. 
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_digits_agglomeration



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_affinity_propagation.py`


.. raw:: html


    <p>Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Poin...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_affinity_propagation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_agglomerative_clustering.py`


.. raw:: html


    <p>This example shows the effect of imposing a connectivity graph to capture local structure in th...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_agglomerative_clustering



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_lena_segmentation.py`


.. raw:: html


    <p>This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_lena_segmentation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_dbscan.py`


.. raw:: html


    <p>Finds core samples of high density and expands clusters from them.
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_dbscan



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example uses a large dataset of faces to learn a set of 20 x 20 images patches that consti...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_dict_face_patches



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_lena_compress.py`


.. raw:: html


    <p>The classic image processing example, Lena, an 8-bit grayscale bit-depth, 512 x 512 sized image...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_lena_compress



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Example builds a swiss roll dataset and runs hierarchical clustering on their position.
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_ward_structured_vs_unstructured



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_segmentation_toy.py`


.. raw:: html


    <p>In this example, an image with connected circles is generated and spectral clustering is used t...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_segmentation_toy



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_cluster_iris.py`


.. raw:: html


    <p>The plots display firstly what a K-means algorithm would yield using three clusters. It is then...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_cluster_iris



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_digits_linkage.py`


.. raw:: html


    <p>An illustration of various linkage option for agglomerative clustering on a 2D embedding of the...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_digits_linkage



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_color_quantization.py`


.. raw:: html


    <p>Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reduci...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_color_quantization



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example compares 2 dimensionality reduction strategies:
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_feature_agglomeration_vs_univariate_selection



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Demonstrates the effect of different metrics on the hierarchical clustering.
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_agglomerative_clustering_metrics



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Evaluate the ability of k-means initializations strategies to make the algorithm convergence ro...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_kmeans_stability_low_dim_dense



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_kmeans_digits.py`


.. raw:: html


    <p>In this example we compare the various initialization strategies for K-means in terms of runtim...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_kmeans_digits



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>The following plots demonstrate the impact of the number of clusters and number of samples on v...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_adjusted_for_chance_measures



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_cluster_plot_cluster_comparison.py`


.. raw:: html


    <p>This example aims at showing characteristics of different clustering algorithms on datasets tha...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_cluster_comparison



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is fa...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cluster/plot_mini_batch_kmeans


.. raw:: html

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


.. _covariance_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and...
    </p></div>
    </div>


.. toctree::
   :hidden:

   covariance/plot_lw_vs_oas



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_covariance_plot_outlier_detection.py`


.. raw:: html


    <p>When the amount of contamination is known, this example illustrates two different ways of perfo...
    </p></div>
    </div>


.. toctree::
   :hidden:

   covariance/plot_outlier_detection



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_covariance_plot_sparse_cov.py`


.. raw:: html


    <p>Using the GraphLasso estimator to learn a covariance and sparse precision from a small number o...
    </p></div>
    </div>


.. toctree::
   :hidden:

   covariance/plot_sparse_cov



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_covariance_plot_covariance_estimation.py`


.. raw:: html


    <p>When working with covariance estimation, the usual approach is to use a maximum likelihood esti...
    </p></div>
    </div>


.. toctree::
   :hidden:

   covariance/plot_covariance_estimation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_covariance_plot_mahalanobis_distances.py`


.. raw:: html


    <p>An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed...
    </p></div>
    </div>


.. toctree::
   :hidden:

   covariance/plot_mahalanobis_distances



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   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` package.






.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with mu...
    </p></div>
    </div>


.. toctree::
   :hidden:

   cross_decomposition/plot_compare_cross_decomposition


.. raw:: html

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


.. _dataset_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This dataset is made up of 1797 8x8 images. Each image, like the one shown below, is of a hand-...
    </p></div>
    </div>


.. toctree::
   :hidden:

   datasets/plot_digits_last_image



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_datasets_plot_random_dataset.py`


.. raw:: html


    <p>Plot several randomly generated 2D classification datasets. This example illustrates the `datas...
    </p></div>
    </div>


.. toctree::
   :hidden:

   datasets/plot_random_dataset



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_datasets_plot_iris_dataset.py`


.. raw:: html


    <p>The rows being the samples and the columns being: Sepal Length, Sepal Width, Petal Length	and P...
    </p></div>
    </div>


.. toctree::
   :hidden:

   datasets/plot_iris_dataset


.. raw:: html

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


.. _decomposition_examples:

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

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






.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour and Virginica) with 4 a...
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_pca_vs_lda



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_decomposition_plot_pca_iris.py`


.. raw:: html


    <p>Principal Component Analysis applied to the Iris dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_pca_iris



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>An example of estimating sources from noisy data.
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_ica_blind_source_separation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_decomposition_plot_kernel_pca.py`


.. raw:: html


    <p>This example shows that Kernel PCA is able to find a projection of the data that makes data lin...
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_kernel_pca



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example illustrates visually in the feature space a comparison by results using two differ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_ica_vs_pca



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_decomposition_plot_sparse_coding.py`


.. raw:: html


    <p>Transform a signal as a sparse combination of Ricker wavelets. This example visually compares d...
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_sparse_coding



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_decomposition_plot_pca_3d.py`


.. raw:: html


    <p>These figures aid in illustrating how a point cloud can be very flat in one direction--which is...
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_pca_3d



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the lik...
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_pca_vs_fa_model_selection



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_decomposition_plot_faces_decomposition.py`


.. raw:: html


    <p>This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dime...
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_faces_decomposition



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_decomposition_plot_image_denoising.py`


.. raw:: html


    <p>An example comparing the effect of reconstructing noisy fragments of the Lena image using first...
    </p></div>
    </div>


.. toctree::
   :hidden:

   decomposition/plot_image_denoising


.. raw:: html

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


.. _ensemble_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example shows the use of forests of trees to evaluate the importance of the pixels in an i...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_forest_importances_faces



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_ensemble_plot_adaboost_regression.py`


.. raw:: html


    <p>A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_adaboost_regression



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_ensemble_plot_forest_importances.py`


.. raw:: html


    <p>This examples shows the use of forests of trees to evaluate the importance of features on an ar...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_forest_importances



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Illustration of the effect of different regularization strategies for Gradient Boosting. The ex...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_gradient_boosting_regularization



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_ensemble_plot_partial_dependence.py`


.. raw:: html


    <p>Partial dependence plots show the dependence between the target function [1]_ and a set of 'tar...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_partial_dependence



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Demonstrate Gradient Boosting on the boston housing dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_gradient_boosting_regression



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example shows how quantile regression can be used to create prediction intervals. 
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_gradient_boosting_quantile



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_ensemble_plot_adaboost_twoclass.py`


.. raw:: html


    <p>This example fits an AdaBoosted decision stump on a non-linearly separable classification datas...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_adaboost_twoclass



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>RandomTreesEmbedding provides a way to map data to a very high-dimensional, sparse representati...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_random_forest_embedding



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_adaboost_hastie_10_2



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_ensemble_plot_adaboost_multiclass.py`


.. raw:: html


    <p>This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_adaboost_multiclass



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


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


.. toctree::
   :hidden:

   ensemble/plot_gradient_boosting_oob



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_ensemble_plot_forest_iris.py`


.. raw:: html


    <p>Plot the decision surfaces of forests of randomized trees trained on pairs of features of the i...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_forest_iris



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_ensemble_plot_bias_variance.py`


.. raw:: html


    <p>This example illustrates and compares the bias-variance decomposition of the expected mean squa...
    </p></div>
    </div>


.. toctree::
   :hidden:

   ensemble/plot_bias_variance


.. raw:: html

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


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

Exercises for the tutorials





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_exercises_digits_classification_exercise.py`


.. raw:: html


    <p>A tutorial exercise regarding the use of classification techniques on the Digits dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   exercises/digits_classification_exercise



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_exercises_plot_cv_digits.py`


.. raw:: html


    <p>A tutorial excercise using Cross-validation with an SVM on the Digits dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   exercises/plot_cv_digits



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_exercises_plot_iris_exercise.py`


.. raw:: html


    <p>A tutorial exercise for using different SVM kernels.
    </p></div>
    </div>


.. toctree::
   :hidden:

   exercises/plot_iris_exercise



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_exercises_plot_cv_diabetes.py`


.. raw:: html


    <p>A tutorial excercise which uses cross-validation with linear models.
    </p></div>
    </div>


.. toctree::
   :hidden:

   exercises/plot_cv_diabetes


.. raw:: html

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


.. _gaussian_process_examples:

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

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






.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example consists in fitting a Gaussian Process model onto the diabetes dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   gaussian_process/gp_diabetes_dataset



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>A two-dimensional regression exercise with a post-processing allowing for probabilistic classif...
    </p></div>
    </div>


.. toctree::
   :hidden:

   gaussian_process/plot_gp_probabilistic_classification_after_regression



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>A simple one-dimensional regression exercise computed in two different ways:
    </p></div>
    </div>


.. toctree::
   :hidden:

   gaussian_process/plot_gp_regression


.. raw:: html

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


.. _linear_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Computes Lasso Path along the regularization parameter using the LARS algorithm on the diabetes...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_lasso_lars



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>A plot that compares the various convex loss functions supported by :class:`sklearn.linear_mode...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_sgd_loss_functions



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Plot the maximum margin separating hyperplane within a two-class separable dataset using a line...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_sgd_separating_hyperplane



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Plot decision function of a weighted dataset, where the size of points is proportional to its w...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_sgd_weighted_samples



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Shows the effect of collinearity in the coefficients of an estimator.
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_ridge_path



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>An example showing how different online solvers perform on the hand-written digits dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_sgd_comparison



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_linear_model_plot_ransac.py`


.. raw:: html


    <p>In this example we see how to robustly fit a linear model to faulty data using the RANSAC algor...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_ransac



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example demonstrates how to approximate a function with a polynomial of degree n_degree by...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_polynomial_interpolation



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wik...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_iris_logistic



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Computes path on IRIS dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_logistic_path



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Ridge regression is basically minimizing a penalised version of the least-squared function. The...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_ols_ridge_variance



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_linear_model_plot_ols.py`


.. raw:: html


    <p>The coefficients, the residual sum of squares and the variance score are also calculated.
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_ols



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_linear_model_plot_logistic.py`


.. raw:: html


    <p>Show in the plot is how the logistic regression would, in this synthetic dataset, classify valu...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_logistic



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_multi_task_lasso_support



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Plot the contours of the three penalties.
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_sgd_penalties



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>We show that linear_model.Lasso provides the same results for dense and sparse data and that in...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/lasso_dense_vs_sparse_data



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Estimates Lasso and Elastic-Net regression models on a manually generated sparse signal corrupt...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_lasso_and_elasticnet



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Computes a Bayesian Ridge Regression on a synthetic dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_bayesian_ridge



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that alth...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_ols_3d



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_linear_model_plot_ard.py`


.. raw:: html


    <p>Fit regression model with Bayesian Ridge Regression.
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_ard



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Comparison of the sparsity (percentage of zero coefficients) of solutions when L1 and L2 penalt...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_logistic_l1_l2_sparsity



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_sgd_iris



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_linear_model_plot_omp.py`


.. raw:: html


    <p>Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encod...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_omp



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Lasso and elastic net (L1 and L2 penalisation) implemented using a coordinate descent.
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_lasso_coordinate_descent_path



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Use the Akaike information criterion (AIC), the Bayes Information criterion (BIC) and cross-val...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_lasso_model_selection



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Given a small number of observations, we want to recover which features of X are relevant to ex...
    </p></div>
    </div>


.. toctree::
   :hidden:

   linear_model/plot_sparse_recovery


.. raw:: html

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


.. _manifold_examples:

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

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






.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_manifold_plot_swissroll.py`


.. raw:: html


    <p>An illustration of Swiss Roll reduction with locally linear embedding 
    </p></div>
    </div>


.. toctree::
   :hidden:

   manifold/plot_swissroll



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_manifold_plot_mds.py`


.. raw:: html


    <p>An illustration of the metric and non-metric MDS on generated noisy data.
    </p></div>
    </div>


.. toctree::
   :hidden:

   manifold/plot_mds



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_manifold_plot_compare_methods.py`


.. raw:: html


    <p>An illustration of dimensionality reduction on the S-curve dataset with various manifold learni...
    </p></div>
    </div>


.. toctree::
   :hidden:

   manifold/plot_compare_methods



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_manifold_plot_manifold_sphere.py`


.. raw:: html


    <p>An application of the different :ref:`manifold` techniques on a spherical data-set. Here one ca...
    </p></div>
    </div>


.. toctree::
   :hidden:

   manifold/plot_manifold_sphere



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_manifold_plot_lle_digits.py`


.. raw:: html


    <p>An illustration of various embeddings on the digits dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   manifold/plot_lle_digits


.. raw:: html

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


.. _mixture_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_mixture_plot_gmm_pdf.py`


.. raw:: html


    <p>Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians...
    </p></div>
    </div>


.. toctree::
   :hidden:

   mixture/plot_gmm_pdf



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_mixture_plot_gmm.py`


.. raw:: html


    <p>Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   mixture/plot_gmm



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_mixture_plot_gmm_sin.py`


.. raw:: html


    <p>This example highlights the advantages of the Dirichlet Process: complexity control and dealing...
    </p></div>
    </div>


.. toctree::
   :hidden:

   mixture/plot_gmm_sin



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_mixture_plot_gmm_selection.py`


.. raw:: html


    <p>This example shows that model selection can be performed with Gaussian Mixture Models using inf...
    </p></div>
    </div>


.. toctree::
   :hidden:

   mixture/plot_gmm_selection



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_mixture_plot_gmm_classifier.py`


.. raw:: html


    <p>Demonstration of Gaussian mixture models for classification.
    </p></div>
    </div>


.. toctree::
   :hidden:

   mixture/plot_gmm_classifier


.. raw:: html

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


.. _neighbors_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_neighbors_plot_regression.py`


.. raw:: html


    <p>Demonstrate the resolution of a regression problem using a k-Nearest Neighbor and the interpola...
    </p></div>
    </div>


.. toctree::
   :hidden:

   neighbors/plot_regression



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_neighbors_plot_classification.py`


.. raw:: html


    <p>Sample usage of Nearest Neighbors classification. It will plot the decision boundaries for each...
    </p></div>
    </div>


.. toctree::
   :hidden:

   neighbors/plot_classification



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_neighbors_plot_nearest_centroid.py`


.. raw:: html


    <p>Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   neighbors/plot_nearest_centroid



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example shows how kernel density estimation (KDE), a powerful non-parametric density estim...
    </p></div>
    </div>


.. toctree::
   :hidden:

   neighbors/plot_digits_kde_sampling



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_neighbors_plot_species_kde.py`


.. raw:: html


    <p>This example does not perform any learning over the data (see :ref:`example_applications_plot_s...
    </p></div>
    </div>


.. toctree::
   :hidden:

   neighbors/plot_species_kde



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_neighbors_plot_kde_1d.py`


.. raw:: html


    <p>The first plot shows one of the problems with using histograms to visualize the density of poin...
    </p></div>
    </div>


.. toctree::
   :hidden:

   neighbors/plot_kde_1d


.. raw:: html

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


.. _semi_supervised_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Example of LabelPropagation learning a complex internal structure to demonstrate "manifold lear...
    </p></div>
    </div>


.. toctree::
   :hidden:

   semi_supervised/plot_label_propagation_structure



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Comparison for decision boundary generated on iris dataset between Label Propagation and SVM.
    </p></div>
    </div>


.. toctree::
   :hidden:

   semi_supervised/plot_label_propagation_versus_svm_iris



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>This example demonstrates the power of semisupervised learning by training a Label Spreading mo...
    </p></div>
    </div>


.. toctree::
   :hidden:

   semi_supervised/plot_label_propagation_digits



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Demonstrates an active learning technique to learn handwritten digits using label propagation.
    </p></div>
    </div>


.. toctree::
   :hidden:

   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` package.





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_svm_nonlinear.py`


.. raw:: html


    <p>Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_svm_nonlinear



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_svm_regression.py`


.. raw:: html


    <p>Toy example of 1D regression using linear, polynomial and RBF kernels.
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_svm_regression



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_separating_hyperplane.py`


.. raw:: html


    <p>Plot the maximum margin separating hyperplane within a two-class separable dataset using a Supp...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_separating_hyperplane



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>Find the optimal separating hyperplane using an SVC for classes that are unbalanced.
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_separating_hyperplane_unbalanced



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_custom_kernel.py`


.. raw:: html


    <p>Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_custom_kernel



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_svm_anova.py`


.. raw:: html


    <p>This example shows how to perform univariate feature before running a SVC (support vector class...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_svm_anova



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_weighted_samples.py`


.. raw:: html


    <p>Plot decision function of a weighted dataset, where the size of points is proportional to its w...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_weighted_samples



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_oneclass.py`


.. raw:: html


    <p>An example using a one-class SVM for novelty detection.
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_oneclass



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_iris.py`


.. raw:: html


    <p>Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_iris



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_svm_kernels.py`


.. raw:: html


    <p>Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_svm_kernels



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_svm_margin.py`


.. raw:: html


    <p>A small value of `C` includes more/all the observations, allowing the margins to be calculated ...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_svm_margin



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>The following example illustrates the effect of scaling the regularization parameter when using...
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_svm_scale_c



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_svm_plot_rbf_parameters.py`


.. raw:: html


    <p>This example illustrates the effect of the parameters `gamma` and `C` of the rbf kernel SVM.
    </p></div>
    </div>


.. toctree::
   :hidden:

   svm/plot_rbf_parameters


.. raw:: html

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


.. _tree_examples:

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

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





.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_tree_plot_tree_regression.py`


.. raw:: html


    <p>A 1D regression with decision tree.
    </p></div>
    </div>


.. toctree::
   :hidden:

   tree/plot_tree_regression



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


.. 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


    <p>An example to illustrate multi-output regression with decision tree.
    </p></div>
    </div>


.. toctree::
   :hidden:

   tree/plot_tree_regression_multioutput



.. raw:: html


    <div class="thumbnailContainer">
        <div class="docstringWrapper">


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

   :ref:`example_tree_plot_iris.py`


.. raw:: html


    <p>Plot the decision surface of a decision tree trained on pairs of features of the iris dataset.
    </p></div>
    </div>


.. toctree::
   :hidden:

   tree/plot_iris


.. raw:: html

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