

.. _sphx_glr_auto_examples_feature_selection:

.. _feature_selection_examples:

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

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



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

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

.. only:: html

  .. image:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_f_test_vs_mi_thumb.png
    :alt:

  :doc:`/auto_examples/feature_selection/plot_f_test_vs_mi`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Comparison of F-test and mutual information</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates and compares two approaches for feature selection: SelectFromModel which is based on feature importance, and SequentialFeatureSelector which relies on a greedy approach.">

.. only:: html

  .. image:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_select_from_model_diabetes_thumb.png
    :alt:

  :doc:`/auto_examples/feature_selection/plot_select_from_model_diabetes`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Model-based and sequential feature selection</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how a feature selection can be easily integrated within a machine learning pipeline.">

.. only:: html

  .. image:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_feature_selection_pipeline_thumb.png
    :alt:

  :doc:`/auto_examples/feature_selection/plot_feature_selection_pipeline`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pipeline ANOVA SVM</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how Recursive Feature Elimination (~sklearn.feature_selection.RFE) can be used to determine the importance of individual pixels for classifying handwritten digits. RFE recursively removes the least significant features, assigning ranks based on their importance, where higher ranking_ values denote lower importance. The ranking is visualized using both shades of blue and pixel annotations for clarity. As expected, pixels positioned at the center of the image tend to be more predictive than those near the edges.">

.. only:: html

  .. image:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_rfe_digits_thumb.png
    :alt:

  :doc:`/auto_examples/feature_selection/plot_rfe_digits`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Recursive feature elimination</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A Recursive Feature Elimination (RFE) example with automatic tuning of the number of features selected with cross-validation.">

.. only:: html

  .. image:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_rfe_with_cross_validation_thumb.png
    :alt:

  :doc:`/auto_examples/feature_selection/plot_rfe_with_cross_validation`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Recursive feature elimination with cross-validation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This notebook is an example of using univariate feature selection to improve classification accuracy on a noisy dataset.">

.. only:: html

  .. image:: /auto_examples/feature_selection/images/thumb/sphx_glr_plot_feature_selection_thumb.png
    :alt:

  :doc:`/auto_examples/feature_selection/plot_feature_selection`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Univariate Feature Selection</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/feature_selection/plot_f_test_vs_mi
   /auto_examples/feature_selection/plot_select_from_model_diabetes
   /auto_examples/feature_selection/plot_feature_selection_pipeline
   /auto_examples/feature_selection/plot_rfe_digits
   /auto_examples/feature_selection/plot_rfe_with_cross_validation
   /auto_examples/feature_selection/plot_feature_selection

