Ignore:
Timestamp:
02/06/12 09:17:03 (2 years ago)
Author:
Miha Stajdohar <miha.stajdohar@…>
Branch:
default
Children:
9663:74b63c8ea80c, 9673:4457401fc0d7
Message:

To Orange25.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/feature/selection.py

    r9653 r9662  
    3939   :members: 
    4040 
    41 .. automethod:: Orange.feature.selection.FilteredLearner 
    42  
    43 .. autoclass:: Orange.feature.selection.FilteredLearner_Class 
     41.. autoclass:: Orange.feature.selection.FilteredLearner 
    4442   :members: 
    4543 
     
    8280    with FSS     0.940 
    8381 
    84 Now, a much simpler example. Although perhaps educational, we can do all of  
    85 the above by wrapping the learner using <code>FilteredLearner</code>, thus  
     82We can do all of  he above by wrapping the learner using 
     83<code>FilteredLearner</code>, thus 
    8684creating an object that is assembled from data filter and a base learner. When 
    87 given the data, this learner uses attribute filter to construct a new 
     85given a data table, this learner uses attribute filter to construct a new 
    8886data set and base learner to construct a corresponding 
    8987classifier. Attribute filters should be of the type like 
    90 <code>orngFSS.FilterAttsAboveThresh</code> or 
    91 <code>orngFSS.FilterBestNAtts</code> that can be initialized with the 
     88<code>orngFSS.FilterAboveThresh</code> or 
     89<code>orngFSS.FilterBestN</code> that can be initialized with the 
    9290arguments and later presented with a data, returning new reduced data 
    9391set. 
    9492 
    95 The following code fragment essentially replaces the bulk of code 
     93The following code fragment replaces the bulk of code 
    9694from previous example, and compares naive Bayesian classifier to the 
    9795same classifier when only a single most important attribute is 
     
    266264 
    267265class FilterAboveThreshold(object): 
    268     """Store filter parameters and can be later called with the data to 
     266    """Store filter parameters that are later called with the data to 
    269267    return the data table with only selected features. 
    270268 
    271     This class uses the function :obj:`select_above_threshold`. 
     269    This class uses :obj:`select_above_threshold`. 
    272270 
    273271    :param measure: an attribute measure (derived from 
     
    307305        """Take data and return features with scores above given threshold. 
    308306 
    309         :param data: an data table 
     307        :param data: data table 
    310308        :type data: Orange.data.table 
    311309 
     
    319317 
    320318class FilterBestN(object): 
    321     """Store filter parameters and can be later called with the data to 
     319    """Store filter parameters that are later called with the data to 
    322320    return the data table with only selected features. 
    323321 
     
    355353 
    356354class FilterRelief(object): 
    357     """Similarly to :obj:`FilterBestNAtts`, wrap around class 
    358     :obj:`FilterRelief_Class`. 
     355    """Store filter parameters that are later called with the data to 
     356    return the data table with only selected features. 
    359357 
    360358    :param measure: an attribute measure (derived from 
     
    391389 
    392390class FilteredLearner(object): 
    393     """Return the corresponding learner that wraps 
    394     :obj:`Orange.classification.baseLearner` and a data selection method. 
    395  
    396     When such learner is presented a data table, data is first filtered and 
     391    """Return the learner that wraps :obj:`Orange.classification.baseLearner`  
     392    and a data selection method. 
     393 
     394    When calling the learner with a data table, data is first filtered and 
    397395    then passed to :obj:`Orange.classification.baseLearner`. This comes handy 
    398396    when one wants to test the schema of feature-subset-selection-and-learning 
     
    408406        nb = Orange.classification.bayes.NaiveBayesLearner() 
    409407        learner = Orange.feature.selection.FilteredLearner(nb, 
    410                   filter=Orange.feature.selection.FilterBestNAtts(n=5), name='filtered') 
     408            filter=Orange.feature.selection.FilterBestN(n=5), name='filtered') 
    411409        classifier = learner(data) 
    412410 
Note: See TracChangeset for help on using the changeset viewer.