_pipeline.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:palladio 作者: slipguru 项目源码 文件源码
def make_classifier(estimator, params=None):
    """Make a classifier for a possible regressor.

    .. deprecated:: 0.5

    Parameters
    ----------
    estimator : sklearn-like class
        It must contain at least a fit and predict method.
    params : dict, optional
        Parameters of the classifier.

    Returns
    -------
    generic_classifier : class
        sklearn-like class that is a subclass of estimator. The predict method
        has been overwritten in order to return only the sign of the results.
        Note: this assumes that labels are 1 and -1.
    """
    if params is None:
        params = {}
    params['predict'] = predict
    params.setdefault('score', accuracy_score)
    return type('GenericClassifier', (estimator,), params)()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号