def __init__(self, imbalance_upsampling=None, class_weight=None, method=None, random_state=10, log=None): MlModelCommon.__init__(self, imbalance_upsampling=imbalance_upsampling, class_weight=class_weight, method=method, log=log) if method == "Bagging": model = DecisionTreeClassifier(class_weight=class_weight, min_samples_split=20, random_state=99) self.ensemble_method = BaggingClassifier(base_estimator=model, n_estimators=10, random_state=random_state) elif method == "Adaptive Boosting": model = DecisionTreeClassifier(class_weight=class_weight, min_samples_split=20, random_state=99) self.ensemble_method = AdaBoostClassifier( base_estimator=model, n_estimators=50, random_state=random_state) else: self.ensemble_method = None DecisionTreeClassifier.__init__(self, class_weight=class_weight, min_samples_split=20, random_state=99)
def __init__(self, **kwargs): DecisionTreeClassifier.__init__(self, **kwargs) return
def __init__(self,threshold=1,ll_ranking=False,**kwargs): DT.__init__(self,**kwargs) BaseClassifier.__init__(self,threshold=threshold,ll_ranking=ll_ranking)
def __init__(self): """ constructor """ DecisionTreeClassifier.__init__(self, max_depth=5)
def __init__(self, dataset, use_relevance=False): DecisionTreeClassifier.__init__(self) self.n_inputs = dataset.data.shape[1] self.n_targets = len(dataset.target_names) self.use_relevance = use_relevance