def __init__(self, alpha=1.0, binarize=.0, fit_prior=True, class_prior=None): _skBernoulliNB.__init__(self, alpha, binarize, fit_prior, class_prior) BaseWrapperClf.__init__(self)
def __init__(self, imbalance_upsampling=None, class_weight=None, method=None, c=100.0, random_state=1, log=None): MlModelCommon.__init__(self, imbalance_upsampling=imbalance_upsampling, class_weight=class_weight, method=method, log=log) if method == "Bagging": model = BernoulliNB() self.ensemble_method = BaggingClassifier(base_estimator=model, n_estimators=10, random_state=random_state) elif method == "Adaptive Boosting": model = BernoulliNB() self.ensemble_method = AdaBoostClassifier( base_estimator=model, n_estimators=10, random_state=random_state) else: # # BernoulliNB does not support class_weight # BernoulliNB.__init__(self) self.ensemble_method = None