python中grid_search_python并行调参—scikit-learn grid_search_scikit learn

python并行调参——scikit-learn grid_search

上篇 应用scikit-learn做文本分类 中以20newsgroups为例讲了如何用三种方法提取训练集=测试集的文本feature,但是

vectorizer取多少个word呢?

预处理时候要过滤掉tf>max_df的words,max_df设多少呢?

tfidftransformer只用tf还是加idf呢?

classifier分类时迭代几次?学习率怎么设?

……

“循环一个个试过来啊”……啊好吧,matlab里就是这么做的……

好在scikit-learn中提供了pipeline(for estimator connection) & grid_search(searching best parameters)进行并行调参。

官网上pipeline 解释如下:

Pipeline  can be used to chain multiple estimators into one. This is useful as there is often a fixed sequence of steps in processing the data, for example feature selection, normalization and classification.  Pipeline  serves two purposes here:

Convenience : You only have to call  fit and  predict once on your data to fit a whole sequence of estimators.

Joint parameter selection : You can  grid search  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值