Ignore:
Timestamp:
02/06/12 17:39:53 (2 years ago)
Author:
lanumek
Branch:
default
rebase_source:
aeea356a746ae91cb578766fe56376f160e20257
Message:

documentation for regression: lasso, linear, pls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/regression/pls.py

    r9671 r9776  
    88.. _`Parital Least Squares Regression`: http://en.wikipedia.org/wiki/Partial_least_squares_regression 
    99 
    10 Implementation is based on `Scikit learn python implementation`_ 
    11  
    12 Example 
    13 ------- 
     10`Partial least squares 
     11<http://en.wikipedia.org/wiki/Partial_least_squares_regression>`_ 
     12regression is a statistical method which can be used to predict 
     13multiple response variables simultaniously. Implementation is based on 
     14`Scikit learn python implementation 
     15<https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/pls.py>`_. 
    1416 
    1517The following code shows how to fit a PLS regression model on a multi-target data set. 
    1618 
    1719.. literalinclude:: code/pls-example.py 
    18  
    19 Output :: 
    20  
    21     Input variables:     <FloatVariable 'X1', FloatVariable 'X2', FloatVariable 'X3'> 
    22     Response variables:  <FloatVariable 'Y1', FloatVariable 'Y2', FloatVariable 'Y3', FloatVariable 'Y4'> 
    23     Prediction for the first 2 data instances:  
     20    :lines: 7,9,13,14 
     21 
     22.. autoclass:: PLSRegressionLearner 
     23    :members: 
     24 
     25.. autoclass:: PLSRegression 
     26    :members: 
     27 
     28Utility functions 
     29----------------- 
     30 
     31.. autofunction:: normalize_matrix 
     32 
     33.. autofunction:: nipals_xy 
     34 
     35.. autofunction:: svd_xy 
     36 
     37 
     38======== 
     39Examples 
     40======== 
     41 
     42To predict values for the first two data instances 
     43use the followin code  
     44 
     45.. literalinclude:: code/pls-example.py 
     46    :lines: 16-20 
     47 
     48Output 
     49 
     50:: 
    2451 
    2552    Actual     [<orange.Value 'Y1'='0.490'>, <orange.Value 'Y2'='1.237'>, <orange.Value 'Y3'='1.808'>, <orange.Value 'Y4'='0.422'>] 
     
    2855    Actual     [<orange.Value 'Y1'='0.167'>, <orange.Value 'Y2'='-0.664'>, <orange.Value 'Y3'='-1.378'>, <orange.Value 'Y4'='0.589'>] 
    2956    Predicted  [<orange.Value 'Y1'='0.058'>, <orange.Value 'Y2'='-0.706'>, <orange.Value 'Y3'='-1.420'>, <orange.Value 'Y4'='0.599'>] 
     57 
     58To see the coefficient of the model (in this case they are stored in a matrix) 
     59print the model 
     60 
     61.. literalinclude:: code/pls-example.py 
     62    :lines: 22 
     63 
     64The ouptut looks like 
     65 
     66:: 
    3067 
    3168    Regression coefficients: 
     
    3572          X3        0.230       -0.314       -0.880       -0.060  
    3673 
    37  
    38  
    39 .. autoclass:: PLSRegressionLearner 
    40     :members: 
    41  
    42 .. autoclass:: PLSRegression 
    43     :members: 
    44  
    45 Utility functions 
    46 ----------------- 
    47  
    48 .. autofunction:: normalize_matrix 
    49  
    50 .. autofunction:: nipals_xy 
    51  
    52 .. autofunction:: svd_xy 
    53  
    54 .. _`Scikit learn python implementation`: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/pls.py 
    5574 
    5675""" 
     
    390409    .. attribute:: x_vars 
    391410     
    392         list of independent variables 
     411        Predictor variables 
    393412 
    394413    .. attribute:: y_vars 
    395414     
    396         list of response variables  
     415        Response variables  
    397416         
    398417    """ 
Note: See TracChangeset for help on using the changeset viewer.