【发布时间】:2019-12-19 04:07:32
【问题描述】:
我正在尝试在 Spark 中创建一个密集矩阵,然后使用以下代码对其进行转置:
val weightsMatrix = Matrices.dense(1, 3, Array.fill[Double](3)(0))
val weightsMatrix_t = weightsMatrix.transpose()
但它失败并出现以下编译错误。
not enough arguments for method apply: (i: Int, j: Int)Double in
trait Matrix.
[error] Unspecified value parameters i, j.
[error] val weightsMatrix_t = weightsMatrix.transpose()
[error] ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
我在文档中检查了函数transpose 不带任何参数,但似乎涉及到一个名为apply 的方法。
【问题讨论】:
标签: scala apache-spark apache-spark-mllib