Changeset 7270:5e29612edd69 in orange


Ignore:
Timestamp:
02/02/11 23:01:18 (3 years ago)
Author:
jzbontar <jure.zbontar@…>
Branch:
default
Convert:
6ba6bddcdec57c5a5c54cdbf0194043a90ae2674
Message:

checkpoint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/classification/logreg.py

    r7251 r7270  
    2727 
    2828.. autoclass:: StepWiseFSS_class 
     29   :members: 
    2930 
    3031Examples 
     
    5253       sex=female       2.42       0.14      17.04       0.00      11.25 
    5354 
    54 Next examples shows how to handle singularities in data sets 
     55The next examples shows how to handle singularities in data sets 
    5556(`logreg-singularities.py`_, uses `adult_sample.tab`_). 
    5657 
     
    120121 
    121122 
    122 We can see that attribute workclass=Never-worked is causeing singularity. The 
    123 issue of this is that we should remove Never-worked manually or leave it to 
    124 function LogRegLearner to remove it automatically.  
    125  
    126 In the last example it is shown, how the use of stepwise logistic 
    127 regression can help us in achieving better classification 
     123We can see that the attribute workclass is causing a singularity. 
     124 
     125The last example shows, how the use of stepwise logistic 
     126regression can help us achieve better classification 
    128127(`logreg-stepwise.py`_, uses `ionosphere.tab`_): 
    129128 
     
    199198def printOUT(classifier): 
    200199    """ Formatted print to console of all major attributes in logistic 
    201     regression classifier. Parameter classifier is a logistic regression 
    202     classifier. 
    203  
    204     :param examples: data set 
    205     :type examples: :obj:`Orange.data.table` 
     200    regression classifier.  
     201 
     202    :param classifier: logistic regression classifier 
    206203    """ 
    207204 
     
    802799 
    803800 
    804 def StepWiseFSS(examples = None, **kwds): 
    805     """ 
    806     If examples are specified, stepwise logistic regression implemented 
    807     in stepWiseFSS_class is performed and a list of chosen attributes 
    808     is returned. If examples are not specified an instance of 
    809     stepWiseFSS_class with all parameters set is returned. Parameters 
    810     addCrit, deleteCrit and numAttr are explained in the description 
    811     of stepWiseFSS_class. 
    812  
    813     :param examples: data set 
    814     :type examples: Orange.data.table 
     801def StepWiseFSS(table=None, **kwds): 
     802    """Implementation of algorithm described in [Hosmer and Lemeshow, Applied Logistic Regression, 2000]. 
     803 
     804    If :obj:`table` is specified, stepwise logistic regression implemented 
     805    in :obj:`stepWiseFSS_class` is performed and a list of chosen attributes 
     806    is returned. If :obj:`table` is not specified an instance of 
     807    :obj:`stepWiseFSS_class` with all parameters set is returned. 
     808 
     809    :param table: data set 
     810    :type table: Orange.data.table 
    815811 
    816812    :param addCrit: "Alpha" level to judge if variable has enough importance to be added in the new set. (e.g. if addCrit is 0.2, then attribute is added if its P is lower than 0.2) 
     
    826822 
    827823    """ 
    828       Constructs and returns a new set of examples that includes a 
     824      Constructs and returns a new set of table that includes a 
    829825      class and attributes selected by stepwise logistic regression. This is an 
    830826      implementation of algorithm described in [Hosmer and Lemeshow, Applied Logistic Regression, 2000] 
    831827 
    832       examples: data set (ExampleTable)      
     828      table: data set (ExampleTable)      
    833829      addCrit: "Alpha" level to judge if variable has enough importance to be added in the new set. (e.g. if addCrit is 0.2, then attribute is added if its P is lower than 0.2) 
    834830      deleteCrit: Similar to addCrit, just that it is used at backward elimination. It should be higher than addCrit! 
     
    838834 
    839835    fss = apply(StepWiseFSS_class, (), kwds) 
    840     if examples is not None: 
    841         return fss(examples) 
     836    if table is not None: 
     837        return fss(table) 
    842838    else: 
    843839        return fss 
     
    877873 
    878874  def __init__(self, addCrit=0.2, deleteCrit=0.3, numAttr = -1, **kwds): 
     875 
    879876    self.__dict__.update(kwds) 
    880877    self.addCrit = addCrit 
Note: See TracChangeset for help on using the changeset viewer.