From user-return-22892-archive-asf-public=cust-asf.ponee.io@mahout.apache.org Tue Jul 7 21:16:03 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5D5E4180656 for ; Tue, 7 Jul 2020 23:16:03 +0200 (CEST) Received: (qmail 12044 invoked by uid 500); 7 Jul 2020 21:16:01 -0000 Mailing-List: contact user-help@mahout.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@mahout.apache.org Delivered-To: mailing list user@mahout.apache.org Received: (qmail 12002 invoked by uid 99); 7 Jul 2020 21:16:00 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jul 2020 21:16:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3C84F181327 for ; Tue, 7 Jul 2020 21:16:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id pEmiM0pmuc8c for ; Tue, 7 Jul 2020 21:15:58 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::32a; helo=mail-ot1-x32a.google.com; envelope-from=andrew.musselman@gmail.com; receiver= Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 2BFB17F660 for ; Tue, 7 Jul 2020 21:15:58 +0000 (UTC) Received: by mail-ot1-x32a.google.com with SMTP id 5so33391726oty.11 for ; Tue, 07 Jul 2020 14:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=kFymgAffktg4ghiPboUNlg3rhDMBcpF3oYFIjVFOhtU=; b=UkwTEAZtuZAwKzw1P9f5nTHpHmprazpU9rkhWkOxwgfKMeeKcD4uL0oquJFM/pvEcT eaN+bUHonlQa0h02i2Vb33VqcRWqLV751r15b0COaYhO6DAk/JvUqbb90UHdN+19PVDl RxNA2Rgw/Z1ZRRMY6vEJaz37yfD633KrueliQdpo37Pvn1Q80y9/yeMVz9VLZGjuH7Nk RshvFDKJxIqqusf6sY04OMIzcec31zBNRuvVwk7fD7xEC7/x8z7E8xhuS1siOiijXQ6N tI3Cyoxz6VTSpe0vBKcchYpuY3im6OyRD0eJ3E6JlKG5WYxZUepXYQxKhEBTFYApAynK KcgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=kFymgAffktg4ghiPboUNlg3rhDMBcpF3oYFIjVFOhtU=; b=uOqnWLhYnXtxHs18SvKp+QHJtpxezFYFUcp5HH3Ed53x8Bv488JGKksVtNk+TMsCiL CeghJzU2J+XnSUp4/xJMb45Wj/DBTKn3KvWNHX8VjJ+p6CQIsSecAsh9onwTAHKWSC0D 9Qb6Dd7kGg/XXsj/YpAhndlp+LdKIOTV2CL4SqEXLrFRyYar550pTJAFVJaZ24+kyxCG YTlk0GiblkEFH5SesUx3USe1YLulfF7KcsJG6j+SlRZW3+MG1OwlJLF/IncDE7iLrqGX lCIhCs6/Q9hUfEasVTrfK3TxnSvyoZYJOlMGFKa1+3WT5PVlzuFbq4lLNwCkwoyVWSrm o4FQ== X-Gm-Message-State: AOAM531bZh1V+V05fn99jhhngJqvvWp0PsabzFUvMhI1Xi7BphU4W7b0 sTpBbXBUNNb4TztPwsb3cSYJXOIPU1JlKGKL/IETfXNYkLA= X-Google-Smtp-Source: ABdhPJxpQrAha5P+30BtoxXZru8YO3JB5LejdjR0fTIw6ddZ5m6UDMOwElU9hvIyrgNlucyRo0HNPek5DZ45AK50IeI= X-Received: by 2002:a9d:2f0a:: with SMTP id h10mr13474668otb.314.1594156551073; Tue, 07 Jul 2020 14:15:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrew Musselman Date: Tue, 7 Jul 2020 14:15:39 -0700 Message-ID: Subject: Re: How to do logical subsetting in Mathout To: user@mahout.apache.org Content-Type: multipart/alternative; boundary="000000000000f176c905a9e07e8b" --000000000000f176c905a9e07e8b Content-Type: text/plain; charset="UTF-8" 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 > > --000000000000f176c905a9e07e8b--