python - 大型数据集上的 Sklearn-GMM

标签 python scikit-learn bigdata mixture-model

我有一个大数据集(我无法将整个数据存储在内存中)。我想在这个数据集上拟合一个 GMM。

我可以在小批量数据上重复使用 GMM.fit() (sklearn.mixture.GMM) 吗??

最佳答案

没有理由反复贴合。 只需随机抽取您认为您的机器可以在合理时间内计算的尽可能多的数据点。如果变异不是很大,随机样本将具有与完整数据集大致相同的分布。

randomly_sampled = np.random.choice(full_dataset, size=10000, replace=False)
#If data does not fit in memory you can find a way to randomly sample when you read it

GMM.fit(randomly_sampled)

和使用

GMM.predict(full_dataset)
# Again you can fit one by one or batch by batch if you cannot read it in memory

对其余的进行分类。

关于python - 大型数据集上的 Sklearn-GMM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29095769/

相关文章:

scala - Spark Streaming中foreach和foreachRDD有什么区别

hadoop - 将数据上传/插入到 HDFS 时是否涉及映射器 reducer ?

python - pdfkit 没有在网页中获取嵌入图像

python - 使用 rpy2 将 .R 文件采购到 python 中的问题

python-3.x - Scikit 学习 sklearn.linear_model.LinearRegression : View the results of the generated model

python - Numpy 数组列表到单个 Numpy 数组而不复制数据

python - 直方图图像未保存

python - 如何在具有不同定位的列表中获取字符串组合?

python - 测试数据的 f1 分数

apache-spark - 如何在 Spark 中处理增量 S3 文件