Changeset 8153:4f0430289d5f in orange


Ignore:
Timestamp:
08/05/11 12:05:24 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
1503857adc1e8c7f7056bebdeac36051df61f885
Message:

Added a preprocessor to EarthLearner (impute missing calues and treat multinomial attrs as ordinal).

File:
1 edited

Legend:

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

    r8150 r8153  
    5050 
    5151import Orange 
    52 from Orange.core import (EarthLearner as BaseEarthLearner, 
    53                          EarthClassifier as BaseEarthClassifier) 
     52from Orange.core import EarthLearner as BaseEarthLearner, \ 
     53                        EarthClassifier as BaseEarthClassifier 
     54from Orange.preprocess import Preprocessor_continuize, \ 
     55                              Preprocessor_impute, \ 
     56                              Preprocessor_preprocessorList, \ 
     57                              DomainContinuizer 
    5458             
    5559import numpy 
     
    119123        self.__dict__.update(kwds) 
    120124         
     125        impute = Preprocessor_impute() 
     126        cont = Preprocessor_continuize(multinomialTreatment= 
     127                                       DomainContinuizer.AsOrdinal) 
     128         
     129        self.preproc = Preprocessor_preprocessorList(preprocessors=\ 
     130                                                     [impute, cont]) 
     131         
    121132    def __call__(self, examples, weight_id=None): 
     133        examples = self.preproc(examples) 
     134         
    122135        if self.multi_label: 
    123136            label_mask = data_label_mask(examples.domain) 
Note: See TracChangeset for help on using the changeset viewer.