Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/Orange.feature.selection.rst

    r10708 r11405  
    8181selects five best features from the data set before learning. 
    8282The new classifier is wrapped-up in a special class (see 
    83 <a href="../ofb/c_pythonlearner.htm">Building your own learner</a> 
    84 lesson in <a href="../ofb/default.htm">Orange for Beginners</a>). The 
    85 script compares this filtered learner with one that uses a complete 
    86 set of features. 
     83:doc:`/tutorial/rst/python-learners` lesson in 
     84:doc:`/tutorial/rst/index`). Th script compares this filtered learner with 
     85one that uses a complete set of features. 
    8786 
    8887:download:`selection-bayes.py<code/selection-bayes.py>` 
     
    9998 
    10099We can do all of  he above by wrapping the learner using 
    101 <code>FilteredLearner</code>, thus 
     100:class:`~Orange.feature.selection.FilteredLearner`, thus 
    102101creating an object that is assembled from data filter and a base learner. When 
    103102given a data table, this learner uses attribute filter to construct a new 
    104103data set and base learner to construct a corresponding 
    105104classifier. Attribute filters should be of the type like 
    106 <code>orngFSS.FilterAboveThresh</code> or 
    107 <code>orngFSS.FilterBestN</code> that can be initialized with the 
    108 arguments and later presented with a data, returning new reduced data 
     105:class:`~Orange.feature.selection.FilterAboveThreshold` or 
     106:class:`~Orange.feature.selection.FilterBestN` that can be initialized with 
     107the arguments and later presented with a data, returning new reduced data 
    109108set. 
    110109 
     
    119118    :lines: 13-16 
    120119 
    121 Now, let's decide to retain three features (change the code in <a 
    122 href="fss4.py">fss4.py</a> accordingly!), but observe how many times 
     120Now, let's decide to retain three features and observe how many times 
    123121an attribute was used. Remember, 10-fold cross validation constructs 
    124122ten instances for each classifier, and each time we run 
    125 FilteredLearner a different set of features may be 
    126 selected. <code>orngEval.CrossValidation</code> stores classifiers in 
    127 <code>results</code> variable, and <code>FilteredLearner</code> 
    128 returns a classifier that can tell which features it used (how 
    129 convenient!), so the code to do all this is quite short. 
     123:class:`~.FilteredLearner` a different set of features may be 
     124selected. ``Orange.evaluation.testing.cross_validation`` stores classifiers in 
     125``results`` variable, and :class:`~.FilteredLearner` 
     126returns a classifier that can tell which features it used, so the code 
     127to do all this is quite short. 
    130128 
    131129.. literalinclude:: code/selection-filtered-learner.py 
    132130    :lines: 25- 
    133131 
    134 Running :download:`selection-filtered-learner.py <code/selection-filtered-learner.py>` with three features selected each 
    135 time a learner is run gives the following result:: 
     132Running :download:`selection-filtered-learner.py <code/selection-filtered-learner.py>` 
     133with three features selected each time a learner is run gives the 
     134following result:: 
    136135 
    137136    Learner      CA 
     
    146145     4 x crime 
    147146 
    148 Experiment yourself to see, if only one attribute is retained for 
    149 classifier, which attribute was the one most frequently selected over 
    150 all the ten cross-validation tests! 
    151147 
    152148========== 
Note: See TracChangeset for help on using the changeset viewer.