<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>scikit-learn: machine learning in Python — scikit-learn 0.18.2 documentation</title> <!-- htmltitle is before nature.css - we use this hack to load bootstrap first --> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="_static/css/bootstrap.min.css" media="screen" /> <link rel="stylesheet" href="_static/css/bootstrap-responsive.css"/> <link rel="stylesheet" href="_static/nature.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/gallery.css" type="text/css" /> <link rel="stylesheet" href="_static/gallery.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '0.18.2', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/js/copybutton.js"></script> <link rel="shortcut icon" href="_static/favicon.ico"/> <link rel="author" title="About these documents" href="about.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="top" title="scikit-learn 0.18.2 documentation" href="#" /> <link rel="next" title="scikit-learn" href="preface.html" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <script src="_static/js/bootstrap.min.js" type="text/javascript"></script> <link rel="canonical" href="https://scikit-learn.org/stable/index.html" /> <script type="text/javascript"> $("div.buttonNext, div.buttonPrevious").hover( function () { $(this).css('background-color', '#FF9C34'); }, function () { $(this).css('background-color', '#A7D6E2'); } ); function showMenu() { var topNav = document.getElementById("scikit-navbar"); if (topNav.className === "navbar") { topNav.className += " responsive"; } else { topNav.className = "navbar"; } }; </script> </head> <body role="document"> <div class="header-wrapper"> <div class="header"> <p class="logo"><a href="#"> <img src="_static/scikit-learn-logo-small.png" alt="Logo"/> </a> </p><div class="navbar" id="scikit-navbar"> <ul> <li><a href="#">Home</a></li> <li><a href="install.html">Installation</a></li> <li class="btn-li"><div class="btn-group"> <a href="documentation.html">Documentation</a> <a class="btn dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> </a> <ul class="dropdown-menu"> <li class="link-title">Scikit-learn 0.18 (stable)</li> <li><a href="tutorial/index.html">Tutorials</a></li> <li><a href="user_guide.html">User guide</a></li> <li><a href="modules/classes.html">API</a></li> <li><a href="faq.html">FAQ</a></li> <li><a href="developers/contributing.html">Contributing</a></li> <li class="divider"></li> <li><a href="http://scikit-learn.org/dev/documentation.html">Scikit-learn 0.19-dev (development)</a></li> <li><a href="http://scikit-learn.org/0.17/documentation.html">Scikit-learn 0.17</a></li> <li><a href="http://scikit-learn.org/0.16/documentation.html">Scikit-learn 0.16</a></li> <li><a href="http://scikit-learn.org/0.15/documentation.html">Scikit-learn 0.15</a></li> <li><a href="_downloads/scikit-learn-docs.pdf">PDF documentation</a></li> </ul> </div> </li> <li><a href="auto_examples/index.html">Examples</a></li> </ul> <a href="javascript:void(0);" onclick="showMenu()"> <div class="nav-icon"> <div class="hamburger-line"></div> <div class="hamburger-line"></div> <div class="hamburger-line"></div> </div> </a> <div class="search_form"> <div id="cse" style="width: 100%;"></div> </div> </div> <!-- end navbar --></div> </div> <!-- Banner --> <div class="container banner-container"> <div class="row-fluid banner-inner"> <div class="hidden-phone"> <div class="span6"> <div class="row-fluid"> <div class="offset2 span8"><div id="index_carousel_tn" class="thumbnail"> <div id="examples_carousel" class="carousel slide" data-interval="false"> <ol id="scikit_learn_index_indicators" class="carousel-indicators"> <li data-target="#examples_carousel" data-slide-to="0" class="active"></li> <li data-target="#examples_carousel" data-slide-to="1"></li> <li data-target="#examples_carousel" data-slide-to="2"></li> <li data-target="#examples_carousel" data-slide-to="3"></li> <li data-target="#examples_carousel" data-slide-to="4"></li> <li data-target="#examples_carousel" data-slide-to="5"></li> <li data-target="#examples_carousel" data-slide-to="6"></li> <li data-target="#examples_carousel" data-slide-to="7"></li> <li data-target="#examples_carousel" data-slide-to="8"></li> <li data-target="#examples_carousel" data-slide-to="9"></li> </ol> <!-- Carousel items --> <div class="carousel-inner"> <div class="active item"> <a href="auto_examples/classification/plot_classifier_comparison.html"> <div class="crop-wrapper" style="width: 380px; height: 190px; overflow: hidden"> <img src="_images/sphx_glr_plot_classifier_comparison_001_carousel.png" style="max-height: 200px; max-width: 629px; margin-left: -21px;"></div></a> </div> <div class="item"> <a href="auto_examples/covariance/plot_outlier_detection.html"> <img src="_images/sphx_glr_plot_outlier_detection_003_carousel.png"></a> </div> <div class="item"> <a href="auto_examples/neighbors/plot_species_kde.html"> <img src="_images/sphx_glr_plot_species_kde_thumb.png"></a> </div> <div class="item"> <a href="auto_examples/linear_model/plot_lasso_lars.html"> <img src="_images/sphx_glr_plot_lasso_lars_thumb.png"></a> </div> <div class="item"> <a href="auto_examples/cluster/plot_cluster_comparison.html"> <img src="_images/sphx_glr_plot_cluster_comparison_thumb.png"></a> </div> <div class="item"> <a href="auto_examples/ensemble/plot_adaboost_twoclass.html"> <img src="_images/sphx_glr_plot_adaboost_twoclass_001_carousel.png"></a> </div> <div class="item"> <a href="auto_examples/gaussian_process/plot_gpr_co2.html"> <img src="_images/sphx_glr_plot_gpr_co2_001_carousel.png"></a> </div> <div class="item"> <a href="auto_examples/manifold/plot_compare_methods.html"> <img src="_images/sphx_glr_plot_compare_methods_001_carousel.png"></a> </div> <div class="item"> <a href="auto_examples/mixture/plot_gmm_pdf.html"> <img src="_images/sphx_glr_plot_gmm_pdf_thumb.png"></a> </div> <div class="item"> <a href="auto_examples/cluster/plot_face_ward_segmentation.html"> <img src="_images/sphx_glr_plot_face_ward_segmentation_thumb.png"></a> </div> </div> <!-- Carousel nav --> <a class="carousel-control left" href="#examples_carousel" data-slide="prev">‹</a> <a class="carousel-control right" href="#examples_carousel" data-slide="next">›</a> </div> </div></div> </div> </div> </div> <div id="intro_to_sklearn_p" class="span6"> <h1>scikit-learn</h1> <h2>Machine Learning in Python</h2> <ul> <li>Simple and efficient tools for data mining and data analysis</li> <li>Accessible to everybody, and reusable in various contexts</li> <li>Built on NumPy, SciPy, and matplotlib</li> <li>Open source, commercially usable - BSD license</li> </ul> </div> </div> </div> <!-- Github "fork me" ribbon --> <a href="https://github.com/scikit-learn/scikit-learn"> <img class="fork-me" style="position: absolute; top: 0; right: 0; border: 0;" src="_static/img/forkme.png" alt="Fork me on GitHub" /> </a> <div class="content-wrapper"> <div class="content"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <!-- Block section --> <div class="container-index"> <div class="container index-upper"> <div class="row-fluid"> <!-- Classification --> <div class="span4 box"> <h2 ><p><a class="reference internal" href="supervised_learning.html#supervised-learning"><span class="std std-ref">Classification</span></a></p> </h2> <blockquote> <p>Identifying to which category an object belongs to.</p> <div class="box-links"> <strong>Applications</strong>: Spam detection, Image recognition.</br> <strong>Algorithms</strong>: <p><a class="reference internal" href="modules/svm.html#svm"><span class="std std-ref">SVM</span></a>, <a class="reference internal" href="modules/neighbors.html#classification"><span class="std std-ref">nearest neighbors</span></a>, <a class="reference internal" href="modules/ensemble.html#forest"><span class="std std-ref">random forest</span></a>, ...</p> <small class="float-right box-example-links"><p><a class="reference internal" href="auto_examples/index.html#general-examples"><span class="std std-ref">Examples</span></a></p> </small> </div> </blockquote> </div> <!-- Regression --> <div class="span4 box"> <h2><p><a class="reference internal" href="supervised_learning.html#supervised-learning"><span class="std std-ref">Regression</span></a></p> </h2> <blockquote> <p>Predicting a continuous-valued attribute associated with an object.</p> <div class="box-links"> <strong>Applications</strong>: Drug response, Stock prices.</br> <strong>Algorithms</strong>: <p><a class="reference internal" href="modules/svm.html#svm"><span class="std std-ref">SVR</span></a>, <a class="reference internal" href="modules/linear_model.html#ridge-regression"><span class="std std-ref">ridge regression</span></a>, <a class="reference internal" href="modules/linear_model.html#lasso"><span class="std std-ref">Lasso</span></a>, ...</p> <small class="float-right box-example-links"><p><a class="reference internal" href="auto_examples/index.html#general-examples"><span class="std std-ref">Examples</span></a></p> </small> </div> </blockquote> </div> <!-- Clustering --> <div class="span4 box"> <h2><p><a class="reference internal" href="modules/clustering.html#clustering"><span class="std std-ref">Clustering</span></a></p> </h2> <blockquote> <p>Automatic grouping of similar objects into sets.</p> <div class="box-links"> <strong>Applications</strong>: Customer segmentation, Grouping experiment outcomes</br> <strong>Algorithms</strong>: <p><a class="reference internal" href="modules/clustering.html#k-means"><span class="std std-ref">k-Means</span></a>, <a class="reference internal" href="modules/clustering.html#spectral-clustering"><span class="std std-ref">spectral clustering</span></a>, <a class="reference internal" href="modules/clustering.html#mean-shift"><span class="std std-ref">mean-shift</span></a>, ...</p> <small class="float-right example-links"><p><a class="reference internal" href="auto_examples/index.html#cluster-examples"><span class="std std-ref">Examples</span></a></p> </small> </div> </blockquote> </div> <!-- row --> </div> <div class="row-fluid"> <!-- Dimension reduction --> <div class="span4 box"> <h2><p><a class="reference internal" href="modules/decomposition.html#decompositions"><span class="std std-ref">Dimensionality reduction</span></a></p> </h2> <blockquote> <p>Reducing the number of random variables to consider.</p> <div class="box-links"> <strong>Applications</strong>: Visualization, Increased efficiency</br> <strong>Algorithms</strong>: <p><a class="reference internal" href="modules/decomposition.html#pca"><span class="std std-ref">PCA</span></a>, <a class="reference internal" href="modules/feature_selection.html#feature-selection"><span class="std std-ref">feature selection</span></a>, <a class="reference internal" href="modules/decomposition.html#nmf"><span class="std std-ref">non-negative matrix factorization</span></a>.</p> <small class="float-right example-links"><p><a class="reference internal" href="auto_examples/index.html#decomposition-examples"><span class="std std-ref">Examples</span></a></p> </small> </div> </blockquote> </div> <!-- Model selection --> <div class="span4 box"> <h2><p><a class="reference internal" href="model_selection.html#model-selection"><span class="std std-ref">Model selection</span></a></p> </h2> <blockquote> <p>Comparing, validating and choosing parameters and models.</p> <div class="box-links"> <strong>Goal</strong>: Improved accuracy via parameter tuning</br> <strong>Modules</strong>: <p><a class="reference internal" href="modules/grid_search.html#grid-search"><span class="std std-ref">grid search</span></a>, <a class="reference internal" href="modules/cross_validation.html#cross-validation"><span class="std std-ref">cross validation</span></a>, <a class="reference internal" href="modules/model_evaluation.html#model-evaluation"><span class="std std-ref">metrics</span></a>.</p> <small class="float-right example-links"><p><a class="reference internal" href="auto_examples/index.html#general-examples"><span class="std std-ref">Examples</span></a></p> </small> </div> </blockquote> </div> <!-- Preprocessing --> <div class="span4 box"> <h2><p><a class="reference internal" href="modules/preprocessing.html#preprocessing"><span class="std std-ref">Preprocessing</span></a></p> </h2> <blockquote> <p>Feature extraction and normalization.</p> <div class="box-links"> <strong>Application</strong>: Transforming input data such as text for use with machine learning algorithms.</br> <strong>Modules</strong>: <p><a class="reference internal" href="modules/preprocessing.html#preprocessing"><span class="std std-ref">preprocessing</span></a>, <a class="reference internal" href="modules/feature_extraction.html#feature-extraction"><span class="std std-ref">feature extraction</span></a>.</p> <span class="example-links"> <small class="float-right example-links"><p><a class="reference internal" href="auto_examples/index.html#general-examples"><span class="std std-ref">Examples</span></a></p> </small> </div> </blockquote> </div> <!-- row --> </div> </div> <!-- container --> <div class="container index-lower"> <div class="row-fluid"> <!-- News --> <div class="span4"> <h4>News</h4> <ul> <li><em>On-going development:</em> <a href="/https/raw.githubusercontent.com/dev/whats_new.html"><em>What's new</em> (Changelog)</a> </li> <li><em>November 2016.</em> scikit-learn 0.18.1 is available for download (<a href="whats_new.html#version-0-18-1">Changelog</a>). </li> <li><em>September 2016.</em> scikit-learn 0.18.0 is available for download (<a href="whats_new.html#version-0-18">Changelog</a>). </li> <li><em>November 2015.</em> scikit-learn 0.17.0 is available for download (<a href="whats_new.html#version-0-17">Changelog</a>). </li> <li><em>March 2015.</em> scikit-learn 0.16.0 is available for download (<a href="whats_new.html#version-0-16">Changelog</a>). </li> <li><em>July 2014.</em> scikit-learn 0.15.0 is available for download (<a href="whats_new.html#version-0-15">Changelog</a>). </li> <li><em>July 14-20th, 2014: international sprint.</em> During this week-long sprint, we gathered 18 of the core contributors in Paris. We want to thank our sponsors: <a href="http://www.campus-paris-saclay.fr/en/Idex-Paris-Saclay/Les-Lidex/Paris-Saclay-Center-for-Data-Science"> Paris-Saclay Center for Data Science</a> & <a href="https://digicosme.lri.fr">Digicosme</a> and our hosts <a href="http://lapaillasse.org">La Paillasse</a>, <a href="http://www.criteo.com/">Criteo</a>, <a href="http://www.inria.fr/">Inria</a>, and <a href="http://www.tinyclues.com/">tinyclues</a>. </li> <li><em>August 2013.</em> scikit-learn 0.14 is available for download (<a href="whats_new.html#version-0-14">Changelog</a>). </li> </ul> </div> <!-- Community --> <div class="span4"> <h4>Community</h4> <ul> <li><em>About us</em> See <a href="about.html#people">authors</a> and <a href="developers/contributing.html">contributing</a></li> <li><em>More Machine Learning</em> Find <a href="related_projects.html">related projects</a></li> <li><em>Questions?</em> See <a href="faq.html">FAQ</a> and <a href="http://stackoverflow.com/questions/tagged/scikit-learn">stackoverflow</a></li> <li><em>Mailing list:</em> <a href="https://mail.python.org/mailman/listinfo/scikit-learn">scikit-learn@python.org</a></li> <li><em>IRC:</em> #scikit-learn @ <a href="http://webchat.freenode.net/">freenode</a></li> </ul> <form target="_top" id="paypal-form" method="post" action="https://www.paypal.com/cgi-bin/webscr"> <input type="hidden" value="_s-xclick" name="cmd"> <input type="hidden" value="74EYUMF3FTSW8" name="hosted_button_id"> </form> <a class="btn btn-warning btn-big" onclick="document.getElementById('paypal-form').submit(); return false;">Help us, <strong>donate!</strong></a> <a class="btn btn-warning btn-big cite-us" href="./about.html#citing-scikit-learn"><strong>Cite us!</strong></a> <small style="display: block; margin-top: 10px"><a href="about.html#funding">Read more about donations</a></small> </div> <!-- who using --> <div class="span4"> <h4>Who uses scikit-learn?</h4> <div id="testimonials_carousel" class="carousel slide"> <div class="carousel-inner"> <div class="active item"> <img src="_images/inria.png" class="thumbnail" /> <p> <em>"We use scikit-learn to support leading-edge basic research [...]"</em> </p> </div> <div class="item"> <img src="_images/spotify.png" class="thumbnail" /> <p> <em>"I think it's the most well-designed ML package I've seen so far."</em> </p> </div> <div class="item"> <img src="_images/change-logo.png" class="thumbnail" /> <p> <em>"scikit-learn's ease-of-use, performance and overall variety of algorithms implemented has proved invaluable [...]."</em> </p> </div> <div class="item"> <img src="_images/evernote.png" class="thumbnail" /> <p> <em>"For these tasks, we relied on the excellent scikit-learn package for Python."</em> </p> </div> <div class="item"> <img src="_images/telecomparistech.jpg" class="thumbnail" /> <p> <em>"The great benefit of scikit-learn is its fast learning curve [...]"</em> </p> </div> <div class="item"> <img src="_images/aweber.png" class="thumbnail" /> <p> <em>"It allows us to do AWesome stuff we would not otherwise accomplish"</em> </p> </div> <div class="item"> <img src="_images/yhat.png" class="thumbnail" /> <p> <em>"scikit-learn makes doing advanced analysis in Python accessible to anyone."</em> </p> </div> </div> </div> <p align="right"> <small class="example-link"> <a href="testimonials/testimonials.html">More testimonials</a> </small> </p> </div> </div> </div> <!--Bottom of index page contributions logos--> <div class="container index-upper" > <div class="row-fluid"> <div class="footer"> <div class="span3"> Funding provided by INRIA and others. </div> <div class="span6"> <a class="reference internal" href="about.html#funding" style="text-decoration: none" > <img id="index-funding-logo-big" src="_static/img/inria-small.png" title="INRIA"> <img id="index-funding-logo-small" src="_static/img/google.png" title="Google"> <!--Due to Télécom ParisTech's logo text being smaller, a style has been added to improve readability--> <img id="index-funding-logo-small" src="_static/img/telecom.png" title="Télécom ParisTech" style="max-height: 36px"> <img id="index-funding-logo-small" src="_static/img/FNRS-logo.png" title="FNRS"> <img id="index-funding-logo-small" src="_static/img/nyu_short_color.png" title="NYU CDS"> <img id="index-funding-logo-small" src="_static/img/columbia.png" title="Columbia University" style="max-height: 36px;"> </a> </div> <div class="span3"> <a class="reference internal" href="about.html#funding"> More information on our contributors </a> </div> </div> </div> </div> </div> <script> $('#testimonials_carousel').carousel() </script><div class="toctree-wrapper compound"> </div> </div> </div> </div> <div class="clearer"></div> </div> </div> <div class="footer"> </div> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-22606712-2']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchControl = new google.search.CustomSearchControl('016639176250731907682:tjtqbvtvij0'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.setAutoComplete(true); customSearchControl.draw('cse', options); }, true); </script> <script src="https://scikit-learn.org/versionwarning.js"></script> </body> </html>