コード例 #1
0
    def __call__(self, data):
        pp = Preprocessor_discretize(attributes=self.features, discretizeClass=self.discretize_class)
        pp.method = self.method
        ddata = pp(data)

        if self.clean:
            return ddata.select([x for x in ddata.domain.features if len(x.values)>1] + [ddata.domain.classVar])
        else:
            return ddata
コード例 #2
0
    def __call__(self, data):
        pp = Preprocessor_discretize(attributes=self.features,
                                     discretizeClass=self.discretize_class)
        pp.method = self.method
        ddata = pp(data)

        if self.clean:
            return ddata.select(
                [x for x in ddata.domain.features if len(x.values) > 1] +
                [ddata.domain.classVar])
        else:
            return ddata
コード例 #3
0
    def __call__(self, data):
        pp = Preprocessor_discretize(attributes=self.features,
                                     discretize_class=self.discretize_class)
        pp.method = self.method
        ddata = pp(data)

        if self.clean:
            features = [x for x in ddata.domain.features if len(x.values) > 1]
            domain = Orange.data.Domain(features, ddata.domain.class_var,
                                        class_vars=ddata.domain.class_vars)
            return Orange.data.Table(domain, ddata)
        else:
            return ddata
コード例 #4
0
    def __call__(self, data):
        pp = Preprocessor_discretize(attributes=self.features,
                                     discretize_class=self.discretize_class)
        pp.method = self.method
        ddata = pp(data)

        if self.clean:
            features = [x for x in ddata.domain.features if len(x.values) > 1]
            domain = Orange.data.Domain(features,
                                        ddata.domain.class_var,
                                        class_vars=ddata.domain.class_vars)
            return Orange.data.Table(domain, ddata)
        else:
            return ddata
コード例 #5
0
 def __call__(self, data, weight=None):
     # filter the data and then learn
     from Orange.preprocess import Preprocessor_discretize
     ddata = Preprocessor_discretize(data, method=self.discretizer)
     if weight <> None:
         model = self.baseLearner(ddata, weight)
     else:
         model = self.baseLearner(ddata)
     dcl = DiscretizedClassifier(classifier=model)
     if hasattr(model, "domain"):
         dcl.domain = model.domain
     if hasattr(model, "name"):
         dcl.name = model.name
     return dcl