gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 20:43:14 28 4
gpt4 key购买 nike

我有一个大数据集(我无法将整个数据存储在内存中)。我想在这个数据集上拟合一个 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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com