星火MLIB矩阵乘法 [英] Spark MLib Matrix Multiplication

查看:244
本文介绍了星火MLIB矩阵乘法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试以下code在星火控制台

I tried the following code in Spark console

import org.apache.spark.mllib.linalg.{Matrix, Matrices, DenseMatrix}

val dm: DenseMatrix = new DenseMatrix(3, 2, Array(1.0, 3.0, 5.0, 2.0, 4.0, 6.0))

val md: DenseMatrix = new DenseMatrix(2, 3, Array(1.0, 3.0, 5.0, 2.0, 4.0, 6.0))

dm.multiply(md) //this line throws an error

这是我得到的错误信息是:

The error message that i get is:

error: value multiply is not a member of org.apache.spark.mllib.linalg.Matrix

同时,我可以叫 dm.toString dm.numRows dm.numCols 我得到的结果,但是当我打电话 dm.multiply ,它抛出一个错误。

meanwhile i can call dm.toString, dm.numRows and dm.numCols i get results but when i call dm.multiply, it throws an error.

我在做什么错了?

推荐答案

我想通了,乘()不支持V1.1.0

i figured out that multiply() is not supported on v1.1.0

<一个href=\"http://spark.apache.org/docs/1.1.0/api/scala/index.html#org.apache.spark.mllib.linalg.DenseMatrix\"相对=nofollow>星火V1.1.0

升级到V1.2.0修正了这个

fixed this by upgrading to v1.2.0

这篇关于星火MLIB矩阵乘法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆