本文整理汇总了Python中MatrixUtil.get_best_reflection方法的典型用法代码示例。如果您正苦于以下问题:Python MatrixUtil.get_best_reflection方法的具体用法?Python MatrixUtil.get_best_reflection怎么用?Python MatrixUtil.get_best_reflection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatrixUtil
的用法示例。
在下文中一共展示了MatrixUtil.get_best_reflection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_canonical_3d_mds
# 需要导入模块: import MatrixUtil [as 别名]
# 或者: from MatrixUtil import get_best_reflection [as 别名]
def get_canonical_3d_mds(D, m, reference_points):
"""
This function is about projecting the points.
It is like MDS except the reflections across the axes are not arbitrary.
Also it only uses the first three axes.
@param D: the full distance matrix
@param m: the mass vector
@param reference_points: a 3D reference projection of vertices of the tree
@return: the weighted MDS points as a numpy matrix
"""
X = Euclid.edm_to_weighted_points(D, m)
X_3d = X.T[:3].T
sign_vector = MatrixUtil.get_best_reflection(X_3d, reference_points)
return X_3d * sign_vector