Changeset 9533:5e2933bb156a in orange


Ignore:
Timestamp:
01/16/12 09:08:25 (2 years ago)
Author:
lanz <lan.zagar@…>
Branch:
default
Convert:
f4fb04c5536eeae5e6f07d961dea83fdf17b1d14
Message:

Updated example code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/regression/pls.py

    r9523 r9533  
    1313 
    1414    >>> import Orange 
    15     >>>     from Orange.regression import pls 
    16     >>> table = Orange.data.Table("test-pls.tab") 
     15    >>> from Orange.regression import pls 
     16    >>> data = Orange.data.Table("test-pls.tab") 
    1717    >>> # set independent and response variables 
    18     >>> x = [var for var in table.domain if var.name[0]=="X"] 
    19     >>> y = [var for var in table.domain if var.name[0]=="Y"] 
     18    >>> x = data.domain.features 
     19    >>> y = data.domain.class_vars 
    2020    >>> print x 
    2121        [FloatVariable 'X1', FloatVariable 'X2', FloatVariable 'X3'] 
     
    2828    >>> # In such situation x and y do not need to be specified. 
    2929    >>> l = pls.PLSRegressionLearner() 
    30     >>> c = l(table, x_vars=x, y_vars=y) 
    31     >>> c.print_pls_regression_coefficients() 
     30    >>> c = l(data, x_vars=x, y_vars=y) 
     31    >>> print c 
    3232           Y1     Y2     Y3     Y4      
    3333    X1     0.513  0.915  0.341  -0.069   
     
    486486    l = pls.PLSRegressionLearner() 
    487487 
    488     x = [var for var in data.domain.features if var.name[0]=="X"] 
    489     y = [var for var in data.domain.class_vars if var.name[0]=="Y"] 
     488    x = data.domain.features 
     489    y = data.domain.class_vars 
    490490    print x, y 
    491 #    c = l(data, x_vars=x, y_vars=y) 
     491    # c = l(data, x_vars=x, y_vars=y) 
    492492    c = l(data) 
    493  
    494493    print c 
Note: See TracChangeset for help on using the changeset viewer.