mds_with_anchors.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:openbadge-analysis 作者: HumanDynamics 项目源码 文件源码
def _gt_mapping(D, W, Z):
    """Computes the mapping B(X) for a Guttman transform V X = B(X) Z."""
    # Compute the Euclidean distances between all pairs of points
    Dz = distance.cdist(Z, Z)
    # Fill the diagonal of Dz, because *we don't want a division by zero*
    np.fill_diagonal(Dz, 1e-5)

    B = - W * D / Dz
    np.fill_diagonal(B, 0.0)
    B[np.diag_indices(B.shape[0])] = -np.sum(B, axis=1)

    return B
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号