Changeset 8169:c9a8b9e448aa in orange


Ignore:
Timestamp:
08/16/11 11:12:07 (3 years ago)
Author:
anze <anze.staric@…>
Branch:
default
Convert:
a65f82cfe15a839bb7a7c5f7be29ea059a5989dd
Message:

Updated pca documentation.

Location:
orange
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/projection/pca.py

    r8072 r8169  
    1111    principal components. This transformation is defined in such a way that the 
    1212    first variable has as high variance as possible. 
    13      
     13 
    1414    If data instances are provided to the constructor, the learning algorithm 
    1515    is called and the resulting classifier is returned instead of the learner. 
     
    4343    def __call__(self, dataset): 
    4444        """ 
    45         Perform a pca analysis on a dataset and return classifer that maps data 
     45        Perform a pca analysis on a dataset and return a classifer that maps data 
    4646        into principal component subspace. 
    4747        """ 
     
    188188        #          for i, a in enumerate(self.input_domain.attributes) 
    189189        #          ]) 
    190         ]) if len(self.pc_domain) <= 16 else \ 
     190        ]) if len(self.pc_domain) <= ncomponents else \ 
    191191        "\n".join([ 
    192192        "PCA SUMMARY", 
  • orange/doc/Orange/rst/Orange.projection.pca.rst

    r8040 r8169  
    88************************************* 
    99 
     10An implementation of `principal component analysis <http://en.wikipedia.org/wiki/Principal_component_analysis>`_. 
     11PCA uses an orthogonal transformation to transform input features into a set of uncorrelated features called principal 
     12components. This transformation is defined in such a way that the first principal component has as high variance as 
     13possible and each succeeding component in turn has the highest variance possible under constraint that is be orthogonal 
     14to the preceding components. 
     15 
     16Because PCA is sensitive to the relative scaling of the original variables the default behaviour of PCA class is to 
     17standardize the input data. 
     18 
     19Learner and Classifier 
     20====================== 
     21 
    1022.. index:: PCA 
    1123.. autoclass:: Orange.projection.pca.Pca 
     
    1426.. autoclass:: Orange.projection.pca.PcaClassifier 
    1527   :members: 
     28 
     29Examples 
     30======== 
     31 
     32The following example demonstrates a straightforward invocation of PCA 
     33(`pca-run.py`_, uses `iris.tab`_): 
     34 
     35.. literalinclude:: code/pca-run.py 
     36   :lines: 7- 
     37 
     38The call to the Pca constructor returns an instance of PcaClassifier, which is later used to transform data to PCA 
     39feature space. Printing the classifier displays how much variance is covered with the first few components. Classifier 
     40can also be used to access transformation vectors (eigen_vectors) and variance of the pca components (eigen_values). 
     41Scree plot can be used when deciding, how many components to keep (`pca-scree.py`_, uses `iris.tab`_): 
     42 
     43.. literalinclude:: code/pca-scree.py 
     44   :lines: 7- 
     45 
     46.. image:: code/pca-scree.png 
     47   :scale: 50 % 
     48 
     49 
     50.. _pca-run.py: code/pca-run.py 
     51.. _iris.tab: code/iris.tab 
Note: See TracChangeset for help on using the changeset viewer.