Errors for block matrix multiplification in Spark

旧巷老猫 提交于 2019-12-24 20:30:29

问题


I have created a coordinate matrix cmat with 9 million rows and 85K columns. I would like to perform cmat.T * cmat operations. I first converted cmat to block matrix bmat:

bmat = cmat.toBlockMatrix(1000, 1000)

However, I got errors when performing multiply():

mtm = bmat.transpose.multiply(bmat)

Traceback (most recent call last): File "", line 1, in AttributeError: 'function' object has no attribute 'multiply'

The Spark version is 2.2.0, scale version is 2.11.8 on DataProc, Google cloud platform. Any suggestions on how to fix the error?


回答1:


The error is saying that the result of operation bmat.transpose is a function not a blockMatrix and therefore has no attribute multiply.

You're just missing ():

mtm = bmat.transpose().multiply(bmat)


来源:https://stackoverflow.com/questions/45821118/errors-for-block-matrix-multiplification-in-spark

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!