您的位置:首页 > 其它

scikit-learn:6. Strategies to scale computationally: bigger data

2015-07-27 09:12 585 查看
参考:http://scikit-learn.org/stable/modules/scaling_strategies.html

对于examples、features(或者两者)数量很大的情况,挑战传统的方法要解决两个问题:内存和效率。办法是Out-of-core (or “external memory”) learning。有三种方法可以实现out-of-core,分别是:

1、Streaming instances(流体化实例):

简单说就是,instances是一个一个来的。具体实现不在scikit-learn文档范围。

2、Extracting features:

简单说就是利用different feature
extraction methods(翻译之后的文章:/article/1323243.html)实现大数据提取有用数据,简化内存、提高效率。不细讲。

3、Incremental
learning:


all
estimators implementing the partial_fit API
are candidates。

the
ability to learn incrementally from a mini-batch of instances (sometimes called “online learning”) is key to out-of-core learning as it guarantees that at any given time there will be only a small amount of instances in the main memory。

所有实现 partial_fit API
的estimators都可以实现增量学习,包括:

Classification

sklearn.naive_bayes.MultinomialNB
sklearn.naive_bayes.BernoulliNB
sklearn.linear_model.Perceptron
sklearn.linear_model.SGDClassifier
sklearn.linear_model.PassiveAggressiveClassifier

Regression

sklearn.linear_model.SGDRegressor
sklearn.linear_model.PassiveAggressiveRegressor

Clustering

sklearn.cluster.MiniBatchKMeans

Decomposition / feature Extraction

sklearn.decomposition.MiniBatchDictionaryLearning
sklearn.decomposition.IncrementalPCA
sklearn.cluster.MiniBatchKMeans

注意:对于分类问题,由于incremental
learner可能不知道所有的classes有哪些,所以第一次调用partial_fit时,最好人工设定参数 classes= ,指明所有类别。

4、Examples:

a
example of Out-of-core
classification of text documents. 通过例子可以更好理解上面的内容。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: