【发布时间】:2019-10-08 03:05:27
【问题描述】:
我有 50GB 的大型数据库,其中包含 780 个专业的 486,000 篇论文的摘录。 出于科学目的,有必要根据这些数据进行培训。但是很可惜,资源仅限于移动处理器、16 GB 内存(+ 16Gb SWAP)
使用一组 40,000 个项目(基数的 10%)(4.5 GB)和 SGDClassifier 分类器进行分析,内存消耗约为 16-17 GB。
因此,我向社区寻求帮助。
目前我的代码类似
text_clf = Pipeline([
('count', CountVectorizer()),
('tfidf', TfidfTransformer()),
('clf', SGDClassifier(n_jobs=8),)
],
)
texts_train, texts_test, cat_train, cat_test = train_test_split(texts, categories_ids, test_size=0.2)
text_clf.fit(texts_train, cat_train)
因此,我请教如何优化这个过程,以便我可以处理整个数据库。
【问题讨论】:
标签: python machine-learning scikit-learn text-classification