You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Naveen <na...@formcept.com> on 2015/08/20 12:24:49 UTC

Convert mllib.linalg.Matrix to Breeze

Hi All,

Is there anyway to convert a mllib matrix to a Dense Matrix of Breeze? 
Any leads are appreciated.


Thanks,
Naveen

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org


Re: Convert mllib.linalg.Matrix to Breeze

Posted by Burak Yavuz <br...@gmail.com>.
Hi Naveen,
As I mentioned before, the code is private therefore not accessible. Just
copy and use the snippet that I sent. Copying it here again:
https://github.com/apache/spark/blob/43e0135421b2262cbb0e06aae53523f663b4f959/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L270

Best,
Burak

On Thu, Aug 20, 2015 at 9:08 PM, Naveen <na...@formcept.com> wrote:

> Hi,
>
> Thanks for the reply. I tried Matrix.toBreeze() which returns the
> following error:
>
> *method toBreeze in trait Matrix cannot be accessed in
> org.apache.spark.mllib.linalg.Matrix*
>
>
>
> On Thursday 20 August 2015 07:50 PM, Burak Yavuz wrote:
>
> Matrix.toBreeze is a private method. MLlib matrices have the same
> structure as Breeze Matrices. Just create a new Breeze matrix like this
> <https://github.com/apache/spark/blob/43e0135421b2262cbb0e06aae53523f663b4f959/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L270>.
>
>
> Best,
> Burak
>
>
> On Thu, Aug 20, 2015 at 3:28 AM, Yanbo Liang <yb...@gmail.com> wrote:
>
>> You can use Matrix.toBreeze()
>> <https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L56>
>>  .
>>
>> 2015-08-20 18:24 GMT+08:00 Naveen <na...@formcept.com>:
>>
>>> Hi All,
>>>
>>> Is there anyway to convert a mllib matrix to a Dense Matrix of Breeze?
>>> Any leads are appreciated.
>>>
>>>
>>> Thanks,
>>> Naveen
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
>>> For additional commands, e-mail: user-help@spark.apache.org
>>>
>>>
>>
>
>

Re: Convert mllib.linalg.Matrix to Breeze

Posted by Naveen <na...@formcept.com>.
Hi,

Thanks for the reply. I tried Matrix.toBreeze() which returns the 
following error:

*/method toBreeze in trait Matrix cannot be accessed in 
org.apache.spark.mllib.linalg.Matrix/*


On Thursday 20 August 2015 07:50 PM, Burak Yavuz wrote:
> Matrix.toBreeze is a private method. MLlib matrices have the same 
> structure as Breeze Matrices. Just create a new Breeze matrix like 
> this 
> <https://github.com/apache/spark/blob/43e0135421b2262cbb0e06aae53523f663b4f959/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L270>. 
>
>
> Best,
> Burak
>
>
> On Thu, Aug 20, 2015 at 3:28 AM, Yanbo Liang <ybliang8@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     You can use Matrix.toBreeze()
>     <https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L56> .
>
>     2015-08-20 18:24 GMT+08:00 Naveen <naveen@formcept.com
>     <ma...@formcept.com>>:
>
>         Hi All,
>
>         Is there anyway to convert a mllib matrix to a Dense Matrix of
>         Breeze? Any leads are appreciated.
>
>
>         Thanks,
>         Naveen
>
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
>         <ma...@spark.apache.org>
>         For additional commands, e-mail: user-help@spark.apache.org
>         <ma...@spark.apache.org>
>
>
>


Re: Convert mllib.linalg.Matrix to Breeze

Posted by Burak Yavuz <br...@gmail.com>.
Matrix.toBreeze is a private method. MLlib matrices have the same structure
as Breeze Matrices. Just create a new Breeze matrix like this
<https://github.com/apache/spark/blob/43e0135421b2262cbb0e06aae53523f663b4f959/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L270>
.

Best,
Burak


On Thu, Aug 20, 2015 at 3:28 AM, Yanbo Liang <yb...@gmail.com> wrote:

> You can use Matrix.toBreeze()
> <https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L56>
>  .
>
> 2015-08-20 18:24 GMT+08:00 Naveen <na...@formcept.com>:
>
>> Hi All,
>>
>> Is there anyway to convert a mllib matrix to a Dense Matrix of Breeze?
>> Any leads are appreciated.
>>
>>
>> Thanks,
>> Naveen
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
>> For additional commands, e-mail: user-help@spark.apache.org
>>
>>
>

Re: Convert mllib.linalg.Matrix to Breeze

Posted by Yanbo Liang <yb...@gmail.com>.
You can use Matrix.toBreeze()
<https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L56>
 .

2015-08-20 18:24 GMT+08:00 Naveen <na...@formcept.com>:

> Hi All,
>
> Is there anyway to convert a mllib matrix to a Dense Matrix of Breeze? Any
> leads are appreciated.
>
>
> Thanks,
> Naveen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
> For additional commands, e-mail: user-help@spark.apache.org
>
>