【发布时间】:2020-02-05 11:03:02
【问题描述】:
我的目标是找出我是否可以在 Python 中操作和测量来自 PCA 或 t-SNE 图的数据。我想知道是否有一种方法可以找到点到集群中心的距离。
我认为有办法,但我不太确定。
【问题讨论】:
标签: python matplotlib keras pca dimensionality-reduction
我的目标是找出我是否可以在 Python 中操作和测量来自 PCA 或 t-SNE 图的数据。我想知道是否有一种方法可以找到点到集群中心的距离。
我认为有办法,但我不太确定。
【问题讨论】:
标签: python matplotlib keras pca dimensionality-reduction
你没有具体说明,但也许这可以帮助你:
聚类技术信息: https://scikit-learn.org/stable/modules/clustering.html#clustering
降维: https://scikit-learn.org/stable/modules/decomposition.html#decompositions
也许下面的脚本可以帮助你:
from sklearn.decomposition import PCA
X= your_data_variables
cluster = "your cluster technique"
cluster.fit(X)
pca=PCA(n_components= 2)
pca.fit(X)
pca_data = pd.DataFrame(pca.transform(X))
centers = pca.transform(cluster.cluster_centers_)
现在您有了聚类中心和二维数据,您可以根据需要计算距离。
【讨论】: