【问题标题】:Distribution of Isotropic Gaussian Blobs generated by sklearn.datasets.make_blobs()?sklearn.datasets.make_blobs() 生成的各向同性高斯 Blob 的分布?
【发布时间】:2021-07-14 14:47:15
【问题描述】:

谁能解释由sklearn.datasets.make_blobs()生成的各向同性高斯斑点的含义。我没有理解它的含义,只在 sklearn 文档中找到了这个 Generate isotropic Gaussian blobs for clustering。我也经历过这个question

所以,这是我的疑问

from sklearn.datasets import make_blobs
# data set generate
X, y = make_blobs(n_samples = 100000, n_features = 2, centers = 2, random_state = 2, cluster_std = 1.5)

# scatter plot of blobs
plt.scatter(X[:, 0], X[:, 1], c = y, s = 50, cmap = 'RdBu')

# distribution of first feature
sns.histplot(x = X[:, 0], kde = True) 

由于该特征遵循的分布近似正态。

# distribuution of second feature
sns.histplot(x = X[ :, 1], kde = True, color = "green", alpha = 0.2 )

第二个特征的分布是不正常的双峰分布。

# overall distribution of values
sns.histplot(x = X.flatten(), color = "red", kde = True, alpha = .5)

这也不正常!

# Variance Covrariance Matrix of Features
np.cov(X[:, 0], X[:, 1])

输出

array([[ 3.55546911,  4.70526192],
       [ 4.70526192, 19.00023664]])

这里的高斯实际上是什么意思!。这可能是一个愚蠢的问题,所以请提前道歉。

【问题讨论】:

    标签: python scikit-learn distribution normal-distribution multivariate-testing


    【解决方案1】:

    简而言之,我正在分享这些东西。

    用于理解的代码 sn-p make_blobs() 在这里。 make_blobs_notebook

    【讨论】:

      猜你喜欢
      • 2010-11-09
      • 1970-01-01
      • 2010-12-13
      • 2020-08-24
      • 2014-11-01
      • 2012-04-02
      • 2011-01-05
      • 2011-06-12
      • 1970-01-01
      相关资源
      最近更新 更多