Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > e578866d55cd81fdb23827cdf3cec911 > files > 553

python-scikits-learn-0.6-1mdv2010.2.i586.rpm



.. _example_plot_pca.py:


====================================
PCA 2d projection of of Iris dataset
====================================

The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
and petal width.

Principal Component Analysis (PCA) applied to this data identifies the
combination of attributes (principal components, or directions in the
feature space) that account for the most variance in the data. Here we
plot the different samples on the 2 first principal components.


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

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

.. literalinclude:: plot_pca.py
    :lines: 15-