當前位置: 首頁>>代碼示例>>Python>>正文


Python tree.ExtraTreeRegressor方法代碼示例

本文整理匯總了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) 
開發者ID:ChenglongChen,項目名稱:kaggle-HomeDepot,代碼行數:17,代碼來源:skl_utils.py

示例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 
開發者ID:cytomine,項目名稱:Cytomine-python-datamining,代碼行數:6,代碼來源:SeparateTreesRegressor.py

示例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 
開發者ID:cytomine,項目名稱:Cytomine-python-datamining,代碼行數:6,代碼來源:VotingTreeRegressor.py

示例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) 
開發者ID:IBM,項目名稱:causallib,代碼行數:12,代碼來源:test_utils.py

示例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) 
開發者ID:pandas-ml,項目名稱:pandas-ml,代碼行數:9,代碼來源:test_tree.py

示例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 
開發者ID:Ibotta,項目名稱:sk-dist,代碼行數:43,代碼來源:ensemble.py


注:本文中的sklearn.tree.ExtraTreeRegressor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。