python scikit学习超参数调优与核心学习

时间:2016-12-11 15:21:21

标签: python machine-learning scikit-learn grid-search large-data

目前我正在使用

clf = SGDClassifier(loss='log', random_state=1, n_iter=1)

我的训练预测模型。但是,训练数据非常大,所以我正在使用核心学习。

clf.partial_fit(X_train, y_train, classes=classes)

另外,我想实现超参数调优,例如GridSearchCVhttp://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html

但是,由于GridSearchCV没有提供partial_fit方法,因此无法进行核外学习,我必须将整个数据集保存在内存中。有没有办法在进行超核心学习的同时进行超参数调整?

1 个答案:

答案 0 :(得分:1)

我找到了一种使用随机森林进行增量学习的方法,有一个名为scikit-graden的库,它们有一个mondrian分类器,可以为随机森林添加增量学习或在线学习。

在mondrian forest上查看此博客: https://medium.com/mlrecipies/mondrian-forests-making-random-forests-better-and-efficient-b27814c681e5