ca.py 文件源码

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

项目:prince 作者: MaxHalford 项目源码 文件源码
def column_cosine_similarities(self):
        """The squared column cosine similarities.

        The column cosine similarities are obtained by calculating the cosine of the angle shaped by
        the column principal coordinates and the column principal components. This is calculated by
        squaring each column projection coordinate and dividing each squared coordinate by the sum
        of the squared coordinates, which results in a ratio comprised between 0 and 1 representing
        the squared cosine.

        Returns:
            pandas.DataFrame: A dataframe of shape (`p`, `k`) containing the squared row cosine
            similarities.
        """
        squared_column_pc = np.square(self.column_principal_coordinates)
        total_squares = squared_column_pc.sum(axis='rows')
        return squared_column_pc.div(total_squares, axis='columns')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号