.. _example_feature_selection_plot_permutation_test_for_classification.py:


=================================================================
Test with permutations the significance of a classification score
=================================================================

In order to test if a classification score is significative a technique
in repeating the classification procedure after randomizing, permuting,
the labels. The p-value is then given by the percentage of runs for
which the score obtained is greater than the classification score
obtained in the first place.




.. image:: images/plot_permutation_test_for_classification_001.png
    :align: center


**Script output**::

  Classification score 0.513333333333 (pvalue : 0.00990099009901)



**Python source code:** :download:`plot_permutation_test_for_classification.py <plot_permutation_test_for_classification.py>`

.. literalinclude:: plot_permutation_test_for_classification.py
    :lines: 13-

**Total running time of the example:**  7.88 seconds
( 0 minutes  7.88 seconds)