1

我需要计算从 RowMatrix 计算的平均向量与同一 RowMatrix 内的所有向量之间的相似度。

为了计算平均向量,我正在这样做(Java 中的示例):

RowMatrix matrix = new RowMatrix(vectorOfUserToItems.rdd());
Vector meanVector = matrix.computeColumnSummaryStatistics().mean();

如何将此向量添加到 RowMatrix“矩阵”中,以便我可以计算相似度,或者我应该以某种不同的方式进行操作?

4

0 回答 0