当前位置: 首页>>代码示例>>Python>>正文


Python utils.tosequence方法代码示例

本文整理汇总了Python中sklearn.utils.tosequence方法的典型用法代码示例。如果您正苦于以下问题:Python utils.tosequence方法的具体用法?Python utils.tosequence怎么用?Python utils.tosequence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sklearn.utils的用法示例。


在下文中一共展示了utils.tosequence方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from sklearn import utils [as 别名]
# 或者: from sklearn.utils import tosequence [as 别名]
def __init__(self, steps, feature_names=None, target_feature=None,
                 exclude_from_ppc=None, exclude_from_fit=None):
        super(H2OPipeline, self).__init__(target_feature=target_feature,
                                          min_version=self._min_version,
                                          max_version=self._max_version)

        # assign to attribute
        self.feature_names = feature_names

        # if we have any to exclude...
        self.exclude_from_ppc = validate_x(exclude_from_ppc)
        self.exclude_from_fit = validate_x(exclude_from_fit)

        names, estimators = zip(*steps)
        if len(dict(steps)) != len(steps):
            raise ValueError("Provided step names are not unique: %s"
                             % (names,))

        # shallow copy of steps
        self.steps = tosequence(steps)
        transforms = estimators[:-1]
        estimator = estimators[-1]

        for t in transforms:
            if not isinstance(t, BaseH2OTransformer):
                raise TypeError("All intermediate steps of the chain should "
                                "be instances of BaseH2OTransformer"
                                " '%s' (type %s) isn't)" % (t, type(t)))

        if not isinstance(estimator, (H2OEstimator, BaseH2OTransformer)):
            raise TypeError("Last step of chain should be an H2OEstimator or BaseH2OTransformer, "
                            "not of type %s" % type(estimator)) 
开发者ID:tgsmith61591,项目名称:skutil,代码行数:34,代码来源:pipeline.py

示例2: __init__

# 需要导入模块: from sklearn import utils [as 别名]
# 或者: from sklearn.utils import tosequence [as 别名]
def __init__(self, steps):
        # Default values
        super().__init__()
        self.steps = tosequence(steps)
        self.active = False

        self.__configure() 
开发者ID:scikit-multiflow,项目名称:scikit-multiflow,代码行数:9,代码来源:pipeline.py

示例3: test_symbol_labels

# 需要导入模块: from sklearn import utils [as 别名]
# 或者: from sklearn.utils import tosequence [as 别名]
def test_symbol_labels():
    # Test with non-integer class labels.
    clf = GradientBoostingClassifier(n_estimators=100, random_state=1)

    symbol_y = tosequence(map(str, y))

    clf.fit(X, symbol_y)
    assert_array_equal(clf.predict(T), tosequence(map(str, true_result)))
    assert_equal(100, len(clf.estimators_)) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:11,代码来源:test_gradient_boosting.py

示例4: __init__

# 需要导入模块: from sklearn import utils [as 别名]
# 或者: from sklearn.utils import tosequence [as 别名]
def __init__(self,
                 estimator_list,
                 cv=3,
                 n_jobs=1,
                 pre_dispatch='2*n_jobs',
                 verbose=0):
        self.estimator_list = tosequence(estimator_list)
        self.cv = cv
        self.n_jobs = n_jobs
        self.pre_dispatch = pre_dispatch
        self.verbose = verbose 
开发者ID:civisanalytics,项目名称:civisml-extensions,代码行数:13,代码来源:stacking.py


注:本文中的sklearn.utils.tosequence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。