<!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>3.5. Feature selection — scikits.learn v0.6.0 documentation</title> <link rel="stylesheet" href="../_static/nature.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '0.6.0', 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> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="top" title="scikits.learn v0.6.0 documentation" href="../index.html" /> <link rel="up" title="3. Supervised learning" href="../supervised_learning.html" /> <link rel="next" title="3.6. Gaussian Processes" href="gaussian_process.html" /> <link rel="prev" title="3.4. Nearest Neighbors" href="neighbors.html" /> </head> <body> <div class="header-wrapper"> <div class="header"> <p class="logo"><a href="../index.html"> <img src="../_static/scikit-learn-logo-small.png" alt="Logo"/> </a> </p><div class="navbar"> <ul> <li><a href="../install.html">Download</a></li> <li><a href="../support.html">Support</a></li> <li><a href="../user_guide.html">User Guide</a></li> <li><a href="../auto_examples/index.html">Examples</a></li> <li><a href="../developers/index.html">Development</a></li> </ul> <div class="search_form"> <div id="cse" style="width: 100%;"></div> <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> </div> </div> <!-- end navbar --></div> </div> <div class="content-wrapper"> <!-- <div id="blue_tile"></div> --> <div class="sphinxsidebar"> <div class="rel"> <a href="neighbors.html" title="3.4. Nearest Neighbors" accesskey="P">previous</a> | <a href="gaussian_process.html" title="3.6. Gaussian Processes" accesskey="N">next</a> | <a href="../genindex.html" title="General Index" accesskey="I">index</a> </div> <h3>Contents</h3> <ul> <li><a class="reference internal" href="#">3.5. Feature selection</a><ul> <li><a class="reference internal" href="#univariate-feature-selection">3.5.1. Univariate feature selection</a><ul> <li><a class="reference internal" href="#feature-scoring-functions">3.5.1.1. Feature scoring functions</a><ul> <li><a class="reference internal" href="#for-classification">3.5.1.1.1. For classification</a></li> <li><a class="reference internal" href="#for-regression">3.5.1.1.2. For regression</a></li> </ul> </li> </ul> </li> </ul> </li> </ul> </div> <div class="content"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="feature-selection"> <span id="feature-selection-doc"></span><h1>3.5. Feature selection<a class="headerlink" href="#feature-selection" title="Permalink to this headline">¶</a></h1> <div class="section" id="univariate-feature-selection"> <h2>3.5.1. Univariate feature selection<a class="headerlink" href="#univariate-feature-selection" title="Permalink to this headline">¶</a></h2> <p>Univariate feature selection works by selecting the best features based on univariate statistical tests. It can seen as a preprocessing step to an estimator. The <cite>scikit.learn</cite> exposes feature selection routines a objects that implement the <cite>transform</cite> method. The k-best features can be selected based on:</p> <p>or by setting a percentile of features to keep using</p> <p>or using common statistical quantities:</p> <p>These objects take as input a scoring function that returns univariate p-values.</p> <div class="topic"> <p class="topic-title first">Examples:</p> <p><a class="reference internal" href="../auto_examples/plot_feature_selection.html#example-plot-feature-selection-py"><em>Univariate Feature Selection</em></a></p> </div> <div class="section" id="feature-scoring-functions"> <h3>3.5.1.1. Feature scoring functions<a class="headerlink" href="#feature-scoring-functions" title="Permalink to this headline">¶</a></h3> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">Beware not to use a regression scoring function with a classification problem.</p> </div> <div class="section" id="for-classification"> <h4>3.5.1.1.1. For classification<a class="headerlink" href="#for-classification" title="Permalink to this headline">¶</a></h4> </div> <div class="section" id="for-regression"> <h4>3.5.1.1.2. For regression<a class="headerlink" href="#for-regression" title="Permalink to this headline">¶</a></h4> </div> </div> </div> </div> </div> </div> </div> <div class="clearer"></div> </div> </div> <div class="footer"> <p style="text-align: center">This documentation is relative to scikits.learn version 0.6.0<p> © 2010, scikits.learn developers (BSD Lincense). Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.5. Design by <a href="http://webylimonada.com">Web y Limonada</a>. </div> </body> </html>