You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Lydia Ickler <ic...@googlemail.com> on 2016/05/30 02:17:52 UTC

sparse matrix

Hi all,

I have two questions regarding sparse matrices:

1. I have a sparse Matrix: val sparseMatrix = SparseMatrix.fromCOO(row, col, csvInput.collect())
and now I would like to extract all values that are in a specific row X. How would I tackle that? flatMap() and filter() do not seem to be supported in that case.

2. I want to drop/delete one specific row and column from the matrix and therefore also reduce the dimension.
How is the smartest way to do so?

Thanks in advance!
Lydia

Re: sparse matrix

Posted by Simone Robutti <si...@radicalbit.io>.
Hello,

right now Flink's local matrices are rather raw and for this kind of usage,
you should rely on Breeze. If you need to perform operations, slicing in
this case, they are a better option if you don't want to reimplement
everything.

In case you already developed against Flink's matrices, there's a useful
converter in org.apache.flink.ml.math.Breeze.

2016-05-30 4:17 GMT+02:00 Lydia Ickler <ic...@googlemail.com>:

> Hi all,
>
> I have two questions regarding sparse matrices:
>
> 1. I have a sparse Matrix: val sparseMatrix = SparseMatrix.fromCOO(row,
> col, csvInput.collect())
> and now I would like to extract all values that are in a specific row X.
> How would I tackle that? flatMap() and filter() do not seem to be
> supported in that case.
>
> 2. I want to drop/delete one specific row and column from the matrix and
> therefore also reduce the dimension.
> How is the smartest way to do so?
>
> Thanks in advance!
> Lydia
>