Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E73E5200D15 for ; Thu, 5 Oct 2017 23:00:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E600B1609E2; Thu, 5 Oct 2017 21:00:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DDF7B1609D2 for ; Thu, 5 Oct 2017 23:00:19 +0200 (CEST) Received: (qmail 95641 invoked by uid 500); 5 Oct 2017 21:00:19 -0000 Mailing-List: contact user-help@predictionio.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@predictionio.incubator.apache.org Delivered-To: mailing list user@predictionio.incubator.apache.org Received: (qmail 95631 invoked by uid 99); 5 Oct 2017 21:00:19 -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; Thu, 05 Oct 2017 21:00:19 +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 3B4C718140C for ; Thu, 5 Oct 2017 21:00:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-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-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id tC_IieOlyhQa for ; Thu, 5 Oct 2017 21:00:17 +0000 (UTC) Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com [209.85.213.54]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 069615FBEE for ; Thu, 5 Oct 2017 21:00:17 +0000 (UTC) Received: by mail-vk0-f54.google.com with SMTP id h4so8766874vkg.0 for ; Thu, 05 Oct 2017 14:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=EvAza/ruuxWEh1xIOqPqOnedCQ27aa7nxO4yiiGM66U=; b=d5qKgsePdPMPwj46KQlksm7M5Maw5utwahPHaa+JsP5kpFC/mW0dzNJUP9AEzoUe9Q xYqfACFSqeBYeXid6dOoYIl36QKcgAhqPdcm9msTXOIJbR58SsG9pyGViLtKt+mkpvsG Q4F+uAmw6JZYKzBHi1XdZx9LjvkRe0z9mg2x2j7RUTXjjiSKXgGSrlnyJXgEqtL+/0K4 QZSksZYHGOPBAWoW9DlB64n/RXHiK058W1jA6Cx33AfW8uofebpvn5JGrBjA6IK48Rbe nVJ4uf+UzQLq9s7ZIZgJcyXFfHz7wUV3JSPObxDxtHu5E75iSlW5F6GKNzPHT0CLER4Q ON+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=EvAza/ruuxWEh1xIOqPqOnedCQ27aa7nxO4yiiGM66U=; b=OYdxx7OKmortoUeHpQHeyWxqOfLeeZP6gtlUe/q3Y0U/jMHjyWVtdyYsPBDNxs/GtN Y6U++M3cD6KpYxk3kcvp04vZw92Cl1anVfEF7x8KMcuBrZruZnc4WTspMqiScJggoJU4 t6PGOwhyUl6EH+JEhDTb4PfdAPbSOU8rBmPsEepklJW9qIiZquRBAAqvew99bFJDEFpq +LVpAEm1wLLV+iRTBQZO/L+e0n5Gm2aWSaNS00PNoK9REQ3vsl+cPwplv+LX/3B5z0+O HWYW+w3Dg3M36Lsj3aG0INIDVzsxbKMISW2zu9n6XAV2fEHGC1cCI9RGNzMHINHj2Bhr 2Piw== X-Gm-Message-State: AMCzsaUh28jmrUIVFdS00BBUddO/yg+elI4xWhErGatvvHrjjU817RhW 4fpHAN9f61rsbbpuboSLvYEyIh7+u/qwh76LDDuodQ== X-Google-Smtp-Source: AOwi7QAFgrbupfwQGzvTva1U0tkSBcz9EhY7Z2oKaCpxt3zX6xNy720ffxya0BYrM7WOtVTKqRMQdtBzMjt7/oIdyC4= X-Received: by 10.31.58.65 with SMTP id h62mr108621vka.97.1507237216311; Thu, 05 Oct 2017 14:00:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.55.108 with HTTP; Thu, 5 Oct 2017 14:00:15 -0700 (PDT) From: Shane Johnson Date: Thu, 5 Oct 2017 15:00:15 -0600 Message-ID: Subject: Adding Spark Context (sc) to predict method? To: user@predictionio.incubator.apache.org Content-Type: multipart/alternative; boundary="001a11438354dee007055ad30283" archived-at: Thu, 05 Oct 2017 21:00:21 -0000 --001a11438354dee007055ad30283 Content-Type: text/plain; charset="UTF-8" Hi team, Can someone guide how I can add SparkContext into the predict method. I am using unique ids that I gather from Query and pulling back additional attributes from the PEventStore and am getting an error that "sc" cannot be found. When I add SparkContext to the method I get the following error. Can anyone provide direction here? Thank you Adding SparkContext eliminates the first error but produces another. def predict(sc: SparkContext, model: RFModel, query: Query): PredictedResult = { val featureIndex = model.featureIndex val featureCategoricalIntMap = model.featureCategoricalIntMap val responses: List[PredictionResponses] = query.predictionRequests .map { Predictions => val oppPost = PEventStore.aggregateProperties( appName = sys.env("PIO_EVENTSERVER_APP_NAME"), entityType = "Opportunity" )(sc) First error when sc: SparkContext is not added to the method parameters: not found: value sc [INFO] [Engine$] [error] )(sc) [INFO] [Engine$] [error] ^ Error after adding SparkContext: class RFAlgorithm needs to be abstract, since method predict in class P2LAlgorithm of type (model: org.template.liftscori ng.RFModel, query: org.template.liftscoring.Query)org.template.liftscoring .PredictedResult is not defined [INFO] [Engine$] [error] class RFAlgorithm(val ap: RFAlgorithmParams) [INFO] [Engine$] [error] ^ [INFO] [Engine$] [error] one error found [INFO] [Engine$] [error] (compile:compileIncremental) Compilation failed [INFO] [Engine$] [error] Total time: 6 s, completed Oct 5, 2017 2:44:51 PM *Shane Johnson | 801.360.3350 <(801)%20360-3350>* LinkedIn | Facebook --001a11438354dee007055ad30283 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi team,

Can someone guide h= ow I can add SparkContext into the predict method. I am using unique ids th= at I gather from Query and pulling back additional attributes from the PEve= ntStore and am getting an error that "sc" cannot be found. When I= add SparkContext to the method I get the following error.

Can anyone provide direction here?=C2=A0

= Thank you

Adding SparkContext eliminates the first= error but produces another.

=C2=A0 def <= span class=3D"gmail-hljs-title" style=3D"color:rgb(136,0,0);font-weight:bol= d">predict= (sc: SparkContext, model: RFModel, query: Query):<= /font> PredictedResult =3D {

=C2=A0 =C2=A0 val featureIndex =3D model.featureIndex
=C2=A0 =C2=A0 val featureCategoricalIntMap =3D model.f= eatureCategoricalIntMap

<= div style=3D"color:rgb(51,51,51)">
=C2=A0 =C2=A0 val responses: List[PredictionResponses] =3D query.predic= tionRequests
=C2=A0 =C2=A0 .map {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Predicti= ons =3D>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 val oppPost= =3D PEventStore.aggregateProperties(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 appName =3D sys.en= v("PIO_= EVENTSERVER_APP_NAME"),
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 entityType =3D "Opportunity"= ;
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 )(sc)


First error when sc: SparkContext is not added to the= method parameters:

not found: value sc
[INFO] [Engine$] [error]=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)(sc)
[INFO] [Engine$] [error]=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^


Error after adding SparkContext:

class RFAlgorithm needs to be abstract, since method predict in class P2LAl= gorithm of type (model: org.template.liftscori
ng.RFMod= el, query: org.template.liftscoring.Query)org.template.liftscor= ing.PredictedResult is not defined
[INFO] [Engine$] = [error] class RFAlgorithm(val ap: RFAlgorithmParams)
[INFO]= [E= ngine$] [error]=C2=A0 =C2=A0 =C2=A0 =C2=A0^
[INFO]= [E= ngine$] [error] one error found
[INFO] [Engine$] = [er= ror] (compile:compileIncremental) Compilation failed
[INFO= ] [Engine$] [error] Total time: 6 s, completed Oct 5, 2017 2:44:51 PM

Shane Johnson | 801.360.3350<= /a>

LinkedIn=C2=A0|=C2=A0Facebook
--001a11438354dee007055ad30283--