【问题标题】:Measuring plots of data with PCA or t-SNE and Matplotlib使用 PCA 或 t-SNE 和 Matplotlib 测量数据图
【发布时间】:2020-02-05 11:03:02
【问题描述】:

我的目标是找出我是否可以在 Python 中操作和测量来自 PCA 或 t-SNE 图的数据。我想知道是否有一种方法可以找到点到集群中心的距离。

我认为有办法,但我不太确定。

【问题讨论】:

    标签: python matplotlib keras pca dimensionality-reduction


    【解决方案1】:

    你没有具体说明,但也许这可以帮助你:

    聚类技术信息: 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_)
    

    现在您有了聚类中心和二维数据,您可以根据需要计算距离。

    【讨论】:

    • 感谢您提供这些资源。抱歉有点含糊,但我想编写一个程序,实时返回成对距离 [?] 将新数据与 t-SNE 或 PCA 数据图进行比较。这可能吗?
    • 我改变我的答案,也许这对你有帮助。
    猜你喜欢
    • 2020-12-04
    • 2017-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-27
    • 2018-11-09
    • 1970-01-01
    相关资源
    最近更新 更多