本文整理汇总了Python中sklearn.ensemble.AdaBoostClassifier.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python AdaBoostClassifier.__init__方法的具体用法?Python AdaBoostClassifier.__init__怎么用?Python AdaBoostClassifier.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sklearn.ensemble.AdaBoostClassifier
的用法示例。
在下文中一共展示了AdaBoostClassifier.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sklearn.ensemble import AdaBoostClassifier [as 别名]
# 或者: from sklearn.ensemble.AdaBoostClassifier import __init__ [as 别名]
def __init__(self,n_estimators=50, learning_rate=1.0, algorithm='SAMME.R',\
criterion='gini', splitter='best', max_depth=5, min_samples_split=2, min_samples_leaf=1,\
max_features=None, random_state=None, min_density=None, compute_importances=None):
base_estimator=DecisionTreeClassifier()
self.base_estimator = base_estimator
self.base_estimator_class = self.base_estimator.__class__
self.n_estimators = n_estimators
self.learning_rate = learning_rate
self.algorithm = algorithm
self.splitter = splitter
self.max_depth = max_depth
self.criterion = criterion
self.max_features = max_features
self.min_density = min_density
self.random_state = random_state
self.min_samples_split = min_samples_split
self.min_samples_leaf = min_samples_leaf
self.compute_importances = compute_importances
self.estimator = self.base_estimator_class(criterion=self.criterion, splitter=self.splitter, max_depth=self.max_depth,\
min_samples_split=self.min_samples_split, min_samples_leaf=self.min_samples_leaf, max_features=self.max_features,\
random_state=self.random_state, min_density=self.min_density, compute_importances=self.compute_importances)
AdaBoostClassifier.__init__(self, base_estimator=self.estimator, n_estimators=self.n_estimators, learning_rate=self.learning_rate, algorithm=self.algorithm)
示例2: __init__
# 需要导入模块: from sklearn.ensemble import AdaBoostClassifier [as 别名]
# 或者: from sklearn.ensemble.AdaBoostClassifier import __init__ [as 别名]
def __init__(self,threshold=1,ll_ranking=False,**kwargs):
AC.__init__(self,**kwargs)
BaseClassifier.__init__(self,threshold=threshold,ll_ranking=ll_ranking)