def __init__(self, mean, std, num):
if mean != None:
self.gauMix = np.random.normal(mean[0], std[0], num[0])
self.gauMix = np.append(self.gauMix, np.random.normal(mean[1], std[1], num[1]))
self.gauMix = np.append(self.gauMix, np.random.normal(mean[2], std[2], num[2]))
self.gmm = GaussianMixture(n_components=3, covariance_type="full", tol=0.001)
self.gmm = self.gmm.fit(X=np.expand_dims(self.gauMix, 1))
评论列表
文章目录