本文整理汇总了Python中sklearn.tree.ExtraTreeRegressor方法的典型用法代码示例。如果您正苦于以下问题:Python tree.ExtraTreeRegressor方法的具体用法?Python tree.ExtraTreeRegressor怎么用?Python tree.ExtraTreeRegressor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sklearn.tree
的用法示例。
在下文中一共展示了tree.ExtraTreeRegressor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sklearn import tree [as 别名]
# 或者: from sklearn.tree import ExtraTreeRegressor [as 别名]
def __init__(self, base_estimator=None, n_estimators=50, max_features=1.0,
max_depth=6, learning_rate=1.0, loss='linear', random_state=None):
if base_estimator and base_estimator == 'etr':
base_estimator = ExtraTreeRegressor(max_depth=max_depth,
max_features=max_features)
else:
base_estimator = DecisionTreeRegressor(max_depth=max_depth,
max_features=max_features)
self.model = sklearn.ensemble.AdaBoostRegressor(
base_estimator=base_estimator,
n_estimators=n_estimators,
learning_rate=learning_rate,
random_state=random_state,
loss=loss)
示例2: build_lonely_tree_regressor
# 需要导入模块: from sklearn import tree [as 别名]
# 或者: from sklearn.tree import ExtraTreeRegressor [as 别名]
def build_lonely_tree_regressor(X, y, max_features, max_depth, min_samples_split):
clf = ExtraTreeRegressor(max_features=max_features, max_depth=max_depth, min_samples_split=min_samples_split)
clf = clf.fit(X, y)
return clf
示例3: build_voting_tree_regressor
# 需要导入模块: from sklearn import tree [as 别名]
# 或者: from sklearn.tree import ExtraTreeRegressor [as 别名]
def build_voting_tree_regressor(X,y,max_features,max_depth,min_samples_split):
clf = ExtraTreeRegressor(max_features=max_features,max_depth=max_depth,min_samples_split=min_samples_split)
clf = clf.fit(X,y)
return clf
示例4: test_check_regression_learner_is_fitted
# 需要导入模块: from sklearn import tree [as 别名]
# 或者: from sklearn.tree import ExtraTreeRegressor [as 别名]
def test_check_regression_learner_is_fitted(self):
from sklearn.linear_model import LinearRegression
from sklearn.tree import ExtraTreeRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.svm import SVR
from sklearn.datasets import make_regression
X, y = make_regression()
for regr in [LinearRegression(), ExtraTreeRegressor(),
GradientBoostingRegressor(), SVR()]:
self.ensure_learner_is_fitted(regr, X, y)
示例5: test_objectmapper
# 需要导入模块: from sklearn import tree [as 别名]
# 或者: from sklearn.tree import ExtraTreeRegressor [as 别名]
def test_objectmapper(self):
df = pdml.ModelFrame([])
self.assertIs(df.tree.DecisionTreeClassifier, tree.DecisionTreeClassifier)
self.assertIs(df.tree.DecisionTreeRegressor, tree.DecisionTreeRegressor)
self.assertIs(df.tree.ExtraTreeClassifier, tree.ExtraTreeClassifier)
self.assertIs(df.tree.ExtraTreeRegressor, tree.ExtraTreeRegressor)
self.assertIs(df.tree.export_graphviz, tree.export_graphviz)
示例6: __init__
# 需要导入模块: from sklearn import tree [as 别名]
# 或者: from sklearn.tree import ExtraTreeRegressor [as 别名]
def __init__(self,
sc=None,
partitions='auto',
n_estimators=100,
max_depth=5,
min_samples_split=2,
min_samples_leaf=1,
min_weight_fraction_leaf=0.,
max_leaf_nodes=None,
min_impurity_decrease=0.,
min_impurity_split=None,
sparse_output=True,
n_jobs=None,
random_state=None,
verbose=0,
warm_start=False):
super().__init__(
base_estimator=ExtraTreeRegressor(),
n_estimators=n_estimators,
estimator_params=("criterion", "max_depth", "min_samples_split",
"min_samples_leaf", "min_weight_fraction_leaf",
"max_features", "max_leaf_nodes",
"min_impurity_decrease", "min_impurity_split",
"random_state"),
bootstrap=False,
oob_score=False,
n_jobs=n_jobs,
random_state=random_state,
verbose=verbose,
warm_start=warm_start)
self.max_depth = max_depth
self.min_samples_split = min_samples_split
self.min_samples_leaf = min_samples_leaf
self.min_weight_fraction_leaf = min_weight_fraction_leaf
self.max_leaf_nodes = max_leaf_nodes
self.min_impurity_decrease = min_impurity_decrease
self.min_impurity_split = min_impurity_split
self.sparse_output = sparse_output
self.sc = sc
self.partitions = partitions