mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Musselman <andrew.mussel...@gmail.com>
Subject Re: How to do logical subsetting in Mathout
Date Tue, 07 Jul 2020 21:15:39 GMT
Kuno, thanks for your note. I don't know of an equivalent function out of
the box, but if you want to get the indices where a condition is true you
could try something in Scala like:

myList.zipWithIndex.collect { case (item, index) if item > 1 => index }

Hope this is helpful.

On Wed, Jun 10, 2020 at 2:53 AM Baeriswyl Kuno SBB CFF FFS (Extern) <
kuno.baeriswyl@sbb.ch> wrote:

> Hi all,
>
> I've pumped into the Mahout, because I need to migrate a R Script
> including matric algebra to Spark Cluster.
>
> Mahouts Scala/Spark Binding provides all of the operations, except of
> logical subsetting.
>
> Example:
>
> x1 = c(1.0,4.0,2.0,5.0)
> x2 = c(0,0,0,0)
> x2[x1 > 1] = 2
>
> Would set value 2 to return Row 2,3 and 4.
>
> Is there an equivalent function in Mahout?
>
>
> Thanks.
>
> Kuno
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message