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')
评论列表
文章目录