API Spark mllib 的 DistributedMatrix 子类不一致

API inconsistency of Spark mllib's DistributedMatrix subclasses

在Spark的MLlib中,为什么不同的分布式矩阵提供的计算接口不一致?例如,RowMatrixIndexRowMatrix提供了computeSVD方法,而CoordinateMatrixBlockMatrix则没有。

这是为什么?

这是因为SVD算法需要面向行(或面向列)的矩阵格式。

如果 CoordinateMatrixBlockMatrix 暴露了一个 computeSVD 方法,在幕后它需要触发一个(可能很昂贵的)转换。