小编Gui*_*aze的帖子

如何使用初始 GaussianMixtureModel 训练 GMM?

我们正在尝试使用 Spark 上的 MLLIB 在 python 中训练具有指定初始模型的高斯混合模型 (GMM)。pyspark 的 Doc 1.5.1 说我们应该使用 GaussianMixtureModel 对象作为 GaussianMixture.train 方法的“initialModel”参数的输入。在创建我们自己的初始模型之前(例如计划使用 Kmean 结果),我们只是想测试这个场景。因此,我们尝试使用第一个训练的输出中的 GaussianMixtureModel 来初始化第二个训练。但这个微不足道的场景会引发错误。您能帮我们确定这里发生了什么吗?非常感谢纪尧姆

PS:我们运行 (py) Spark 1.5.1 和 hadoop 2.6

下面是简单的场景代码和错误:

from pyspark.mllib.clustering import GaussianMixture
from numpy import array
import sys
import os
import pyspark

### Local default options
K=2 # "k" (int) Set the number of Gaussians in the mixture model.  Default: 2
convergenceTol=1e-3 # "convergenceTol" (double) Set the largest change in log-likelihood at which convergence is considered to have occurred.
maxIterations=100 …
Run Code Online (Sandbox Code Playgroud)

python statistics apache-spark pyspark apache-spark-ml

5
推荐指数
1
解决办法
1194
查看次数