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
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
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
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