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 A0E21200CD2 for ; Thu, 27 Jul 2017 11:11:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9F25116A4CB; Thu, 27 Jul 2017 09:11:24 +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 49F9B16A4C8 for ; Thu, 27 Jul 2017 11:11:23 +0200 (CEST) Received: (qmail 8468 invoked by uid 500); 27 Jul 2017 09:11:22 -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 8452 invoked by uid 99); 27 Jul 2017 09:11:22 -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, 27 Jul 2017 09:11:22 +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 ECB06180647 for ; Thu, 27 Jul 2017 09:11:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.15 X-Spam-Level: X-Spam-Status: No, score=-0.15 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, HTML_OBFUSCATE_05_10=0.001, JMQ_TRACKER=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, 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-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id SeB67m485zEg for ; Thu, 27 Jul 2017 09:11:17 +0000 (UTC) Received: from mail-ua0-f171.google.com (mail-ua0-f171.google.com [209.85.217.171]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 000BD5F522 for ; Thu, 27 Jul 2017 09:11:16 +0000 (UTC) Received: by mail-ua0-f171.google.com with SMTP id q25so116972893uah.1 for ; Thu, 27 Jul 2017 02:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=3l3V0tZkbyn8WugwK5yN97eX/s75kTDTGqpKeV8BEDs=; b=UmjwjLJxOR0Pje+15n7VHzfHrevp1ZNOh1VnrPVtrvkW+QeoHixocEmzvs1DQ6zQPE zeokpL3zJLaBTkPFv8S1OjZzEcUN9ocoZ4cYBTn3GSjALodh+j0lcFgDNUVSi8oVCZN5 tfZcz5iyW1Oqzvd1GB64U3/ZbsPujSYshDObssAik1gVkUSyMDicx/vXHWVm5v+078v6 09nAfV+4ZpscwjmIGWr+SzjmLBi4DObB4V5zH78YIdEwXB8FoVf/k72Fpe/Q4RiOPq09 QO67edUSrhhBFi/Q/7AKIkWfftocmTMcxUsB2krOqscw3ig/7GhLQIyPSZfjU4U5b2Kn TLYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=3l3V0tZkbyn8WugwK5yN97eX/s75kTDTGqpKeV8BEDs=; b=bvMRdf2erUA9TUL8FVz1SkTy8bWRuabGjCGBBqIMTbL+lFsasPCjG8/Q/Fhr2oYNmz LupGNDVuE/Ug4InQ86gzYIm+T80FcHIkSijrGRArAz+DZghzvf/yaC2Vzx+rlCz7xYQd /ByQOvg9rAopgrovbI+oU/KHxa2lu+O6LX6CtUndO3A89L1Ne8GgiGcpz+ZUeOaF73aC 6PNohlMWQ5u2jdvkhZQs16DO5ja1kmVBf38VbNRLoUr4IWGfjC3PJ4/x7C9KuWbJwNpZ rQky23n+9L+6KeGUNIwaIaT98fMN0f8UTsfSyKzmHnxkoZJZU5WO2m3uxvO3UzoUIyvD Hc0Q== X-Gm-Message-State: AIVw112HupptpNWmy0rq6FCW+Rzmka1B3QoVTDlTZfPESDHmnQNq2XNg 1aYCgk3Sr7FrRnpnnENTydCE1ImTag== X-Received: by 10.31.193.141 with SMTP id r135mr2195983vkf.113.1501146669877; Thu, 27 Jul 2017 02:11:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.60.17 with HTTP; Thu, 27 Jul 2017 02:11:09 -0700 (PDT) In-Reply-To: References: From: Vaghawan Ojha Date: Thu, 27 Jul 2017 14:56:09 +0545 Message-ID: Subject: Re: Pio build success with error, pio train is faililng. To: user@predictionio.incubator.apache.org Content-Type: multipart/alternative; boundary="001a114dba4e038d26055548f2e1" archived-at: Thu, 27 Jul 2017 09:11:24 -0000 --001a114dba4e038d26055548f2e1 Content-Type: text/plain; charset="UTF-8" Hi Darshan, Thanks, yes I myself had undergone with so many difficulties during installation so I had covered them in that article. Also I've been trying to make one or two examples with ur in the pio docs. For your current error, you need to change the appName in engine.json and rebuild your app again. On Thu, Jul 27, 2017 at 2:49 PM, Darshan A.N. wrote: > hi VO, > thats really impressive article you have written. i need to install that > DEMO-tapster. my repository is mysql, could you please help me solving it? > thanks and cheers for ur article, i suppose it must be helpful for lot of > noobies like me. > -DAN > > On Wed, Jul 26, 2017 at 3:37 PM, Vaghawan Ojha > wrote: > >> Hi Darshan, >> >> I had written a brief article on medium to start from scratch, you could >> follow that as well. https://medium.freecodec >> amp.org/building-an-recommendation-engine-with-apache- >> prediction-io-ml-server-aed0319e0d8 >> here's the link. I myself had faced lots of problems while installation, >> but pio and ur community is great for instant support. I've included common >> errors and there troubleshooting as well. >> >> Hope this helps. >> >> Thanks >> Vaghawan >> >> On Wed, Jul 26, 2017 at 3:37 PM, Tom Chan wrote: >> >>> darshan@darshu:~/PredictionIO/tapster-episode-similar/src/main/scala$ >>> pio train >>> >>> Can you try the command from the tapster-episode-similar directory? >>> >>> Tom >>> >>> On Jul 26, 2017 2:45 AM, "Darshan A.N." wrote: >>> >>>> hi team, >>>> i am trying to install demo tapster. i followed >>>> http://predictionio.incubator.apache.org/demo/tapster/. It took >>>> more than a week to install predictionio. >>>> now that i m installed the PIO, its throwing me error while running the >>>> $pio build command. the error goes like this: >>>> darshan@darshu:~/PredictionIO/tapster-episode-similar$ pio build >>>> SLF4J: Class path contains multiple SLF4J bindings. >>>> SLF4J: Found binding in [jar:file:/home/darshan/Predic >>>> tionIO/lib/spark/pio-data-hdfs-assembly-0.11.0-incubating.ja >>>> r!/org/slf4j/impl/StaticLoggerBinder.class] >>>> SLF4J: Found binding in [jar:file:/home/darshan/Predic >>>> tionIO/lib/pio-assembly-0.11.0-incubating.jar!/org/slf4j/imp >>>> l/StaticLoggerBinder.class] >>>> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an >>>> explanation. >>>> SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] >>>> [INFO] [Engine$] Using command '/home/darshan/PredictionIO/sbt/sbt' at >>>> /home/darshan/PredictionIO/tapster-episode-similar to build. >>>> [INFO] [Engine$] If the path above is incorrect, this process will fail. >>>> [INFO] [Engine$] Uber JAR disabled. Making sure >>>> lib/pio-assembly-0.11.0-incubating.jar is absent. >>>> [INFO] [Engine$] Going to run: /home/darshan/PredictionIO/sbt/sbt >>>> package assemblyPackageDependency in /home/darshan/PredictionIO/tap >>>> ster-episode-similar >>>> [ERROR] [Engine$] [error] /home/darshan/PredictionIO/tap >>>> ster-episode-similar/src/main/scala/DataSource.scala:63: not found: >>>> value eventsDb >>>> [ERROR] [Engine$] [error] val viewEventsRDD: RDD[ViewEvent] = >>>> eventsDb.find( >>>> [ERROR] [Engine$] [error] ^ >>>> [ERROR] [Engine$] [error] one error found >>>> [ERROR] [Engine$] [error] (compile:compileIncremental) Compilation >>>> failed >>>> [ERROR] [Engine$] [error] Total time: 5 s, completed 26 Jul, 2017 >>>> 1:56:50 AM >>>> [ERROR] [Engine$] Return code of build command: >>>> /home/darshan/PredictionIO/sbt/sbt package assemblyPackageDependency >>>> is 1. Aborting. >>>> [INFO] [Engine$] Looking for an engine... >>>> [INFO] [Engine$] Found template-scala-parallel-simila >>>> rproduct_2.10-0.1-SNAPSHOT.jar >>>> [INFO] [Engine$] Found template-scala-parallel-simila >>>> rproduct-assembly-0.1-SNAPSHOT-deps.jar >>>> [INFO] [Engine$] Build finished successfully. >>>> [INFO] [Pio$] Your engine is ready for training. >>>> >>>> >>>> and the file DataSource.scala, >>>> >>>> >>>> package org.example.similarproduct >>>> >>>> import org.apache.predictionio.controller.PDataSource >>>> import org.apache.predictionio.controller.EmptyEvaluationInfo >>>> import org.apache.predictionio.controller.EmptyActualResult >>>> import org.apache.predictionio.controller.Params >>>> import org.apache.predictionio.data.storage.Event >>>> import org.apache.predictionio.data.store.PEventStore >>>> >>>> import org.apache.spark.SparkContext >>>> import org.apache.spark.SparkContext._ >>>> import org.apache.spark.rdd.RDD >>>> >>>> import grizzled.slf4j.Logger >>>> >>>> case class DataSourceParams(appName: String) extends Params >>>> >>>> class DataSource(val dsp: DataSourceParams) >>>> extends PDataSource[TrainingData, >>>> EmptyEvaluationInfo, Query, EmptyActualResult] { >>>> >>>> @transient lazy val logger = Logger[this.type] >>>> >>>> override >>>> def readTraining(sc: SparkContext): TrainingData = { >>>> >>>> // create a RDD of (entityID, User) >>>> val usersRDD: RDD[(String, User)] = PEventStore.aggregatePropertie >>>> s( >>>> appName = dsp.appName, >>>> entityType = "user" >>>> )(sc).map { case (entityId, properties) => >>>> val user = try { >>>> User() >>>> } catch { >>>> case e: Exception => { >>>> logger.error(s"Failed to get properties ${properties} of" + >>>> s" user ${entityId}. Exception: ${e}.") >>>> throw e >>>> } >>>> } >>>> (entityId, user) >>>> }.cache() >>>> >>>> // create a RDD of (entityID, Item) >>>> val itemsRDD: RDD[(String, Item)] = PEventStore.aggregatePropertie >>>> s( >>>> appName = dsp.appName, >>>> entityType = "item" >>>> )(sc).map { case (entityId, properties) => >>>> val item = try { >>>> // Assume categories is optional property of item. >>>> Item(categories = properties.getOpt[List[String] >>>> ]("categories")) >>>> } catch { >>>> case e: Exception => { >>>> logger.error(s"Failed to get properties ${properties} of" + >>>> s" item ${entityId}. Exception: ${e}.") >>>> throw e >>>> } >>>> } >>>> (entityId, item) >>>> }.cache() >>>> >>>> // get all "user" "view" "item" events >>>> val viewEventsRDD: RDD[ViewEvent] = eventsDb.find( >>>> appId = dsp.appId, >>>> entityType = Some("user"), >>>> eventNames = Some(List("like")), >>>> // targetEntityType is optional field of an event. >>>> targetEntityType = Some(Some("item")))(sc) >>>> // eventsDb.find() returns RDD[Event] >>>> .map { event => >>>> val viewEvent = try { >>>> event.event match { >>>> case "like" => ViewEvent( >>>> user = event.entityId, >>>> item = event.targetEntityId.get, >>>> t = event.eventTime.getMillis) >>>> case _ => throw new Exception(s"Unexpected event ${event} >>>> is read.") >>>> } >>>> } catch { >>>> case e: Exception => { >>>> logger.error(s"Cannot convert ${event} to ViewEvent." + >>>> s" Exception: ${e}.") >>>> throw e >>>> } >>>> } >>>> viewEvent >>>> }.cache() >>>> >>>> new TrainingData( >>>> users = usersRDD, >>>> items = itemsRDD, >>>> viewEvents = viewEventsRDD >>>> ) >>>> } >>>> } >>>> >>>> case class User() >>>> >>>> case class Item(categories: Option[List[String]]) >>>> >>>> case class ViewEvent(user: String, item: String, t: Long) >>>> >>>> class TrainingData( >>>> val users: RDD[(String, User)], >>>> val items: RDD[(String, Item)], >>>> val viewEvents: RDD[ViewEvent] >>>> ) extends Serializable { >>>> override def toString = { >>>> s"users: [${users.count()} (${users.take(2).toList}...)]" + >>>> s"items: [${items.count()} (${items.take(2).toList}...)]" + >>>> s"viewEvents: [${viewEvents.count()}] (${viewEvents.take(2).toList}. >>>> ..)" >>>> } >>>> } >>>> >>>> >>>> >>>> >>>> while training, it gives me following error, >>>> >>>> >>>> >>>> >>>> darshan@darshu:~/PredictionIO/tapster-episode-similar/src/main/scala$ >>>> pio train >>>> SLF4J: Class path contains multiple SLF4J bindings. >>>> SLF4J: Found binding in [jar:file:/home/darshan/Predic >>>> tionIO/lib/spark/pio-data-hdfs-assembly-0.11.0-incubating.ja >>>> r!/org/slf4j/impl/StaticLoggerBinder.class] >>>> SLF4J: Found binding in [jar:file:/home/darshan/Predic >>>> tionIO/lib/pio-assembly-0.11.0-incubating.jar!/org/slf4j/imp >>>> l/StaticLoggerBinder.class] >>>> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an >>>> explanation. >>>> SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] >>>> [WARN] [Template$] /home/darshan/PredictionIO/tap >>>> ster-episode-similar/src/main/scala/template.json does not exist. >>>> Template metadata will not be available. (This is safe to ignore if you are >>>> not working on a template.) >>>> Exception in thread "main" java.io.FileNotFoundException: >>>> /home/darshan/PredictionIO/tapster-episode-similar/src/main/scala/engine.json >>>> (No such file or directory) >>>> at java.io.FileInputStream.open0(Native Method) >>>> at java.io.FileInputStream.open(FileInputStream.java:195) >>>> at java.io.FileInputStream.(FileInputStream.java:138) >>>> at scala.io.Source$.fromFile(Source.scala:90) >>>> at scala.io.Source$.fromFile(Source.scala:75) >>>> at org.apache.predictionio.tools.console.Console$.getEngineInfo >>>> (Console.scala:724) >>>> at org.apache.predictionio.tools.RunWorkflow$.runWorkflow(RunWo >>>> rkflow.scala:54) >>>> at org.apache.predictionio.tools.commands.Engine$.train(Engine. >>>> scala:186) >>>> at org.apache.predictionio.tools.console.Pio$.train(Pio.scala:85) >>>> at org.apache.predictionio.tools.console.Console$$anonfun$main$ >>>> 1.apply(Console.scala:626) >>>> at org.apache.predictionio.tools.console.Console$$anonfun$main$ >>>> 1.apply(Console.scala:611) >>>> at scala.Option.map(Option.scala:145) >>>> at org.apache.predictionio.tools.console.Console$.main(Console. >>>> scala:611) >>>> at org.apache.predictionio.tools.console.Console.main(Console.s >>>> cala) >>>> >>>> >>>> >>>> i tried almost all the things, but could not find the proper solution. >>>> please help me... >>>> i know you may feel bit odd about this mail, but in need of your help. >>>> >>>> thanks, >>>> >>>> >>>> -DAN >>>> >>> >> > --001a114dba4e038d26055548f2e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Darshan,=C2=A0

Thanks, yes I myself = had undergone with so many difficulties during installation=C2=A0so I had c= overed them in that article. Also I've been trying to make one or two e= xamples with ur in the pio docs.=C2=A0

For your cu= rrent error, you need to change the appName in engine.json and rebuild your= app again.=C2=A0

On Thu, Jul 27, 2017 at 2:49 PM, Darshan A.N. <darshanan.= 24@gmail.com> wrote:
hi VO,
thats really impressive article y= ou have written. i need to install that DEMO-tapster. my repository is mysq= l, could you please help me solving it?
thanks and cheers for ur a= rticle, i suppose it must be helpful for lot of noobies like me.
-DAN

On Wed, Jul 26, 2017 at 3:37 PM, Vaghawan Ojha &l= t;vaghawan781@gm= ail.com> wrote:
Hi Darshan,=C2=A0

I had written a brief article on= medium to start from scratch, you could follow that as well.=C2=A0https://mediu= m.freecodecamp.org/building-an-recommendation-engine-with-apache-= prediction-io-ml-server-aed0319e0d8
here's the = link. I myself had faced lots of problems while installation, but pio=C2=A0= and ur community is great for instant support. I've included common err= ors and there troubleshooting as well.=C2=A0

Hope = this helps.=C2=A0

Thanks
Vaghawan
<= img src=3D"http://t.sidekickopen69.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9= gXrN7sKj6v5dpCFVdnscn3M2z18W63Bb_s3LvrVvW3ZBnHX1k1H6H0?si=3D511028666735001= 6&pi=3Da5c2d423-529f-4906-f180-8300867d3122" style=3D"display:none!impo= rtant" width=3D"1" height=3D"1">
<= br>
On Wed, Jul 26, 2017 at 3:37 PM, Tom Chan <yukhei.chan@gmail.com> wrote:
darshan@darshu:~/PredictionIO/tapster-episode-similar/src/main/scala$ pio trai= n

Can you try the command from the tapster-episode= -similar directory?=C2=A0

Tom=

On Jul 2= 6, 2017 2:45 AM, "Darshan A.N." <darshanan.24@gmail.com> wrote:
hi t= eam,
i am trying to install demo tapster. i=C2=A0 followed http://predictionio.incubator.apache.org/demo/tapster/.=C2=A0=C2=A0=C2=A0=C2=A0 It took more than a week to install predictioni= o.
now that i m installed the PIO, its throwing me error while running t= he $pio build command. the error goes like this:
darshan@darshu:~/Predic= tionIO/tapster-episode-similar$ pio build
SLF4J: Class path contain= s multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/darsh= an/PredictionIO/lib/spark/pio-data-hdfs-assembly-0.11.0-incubatin= g.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found b= inding in [jar:file:/home/darshan/PredictionIO/lib/pio-assembly-0.11.0= -incubating.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4= J: See
http://www.slf4j.org/codes.html#multiple_= bindings for an explanation.
SLF4J: Actual binding is of type [org.s= lf4j.impl.Log4jLoggerFactory]
[INFO] [Engine$] Using command '/= home/darshan/PredictionIO/sbt/sbt' at /home/darshan/PredictionIO/t= apster-episode-similar to build.
[INFO] [Engine$] If the path above= is incorrect, this process will fail.
[INFO] [Engine$] Uber JAR disable= d. Making sure lib/pio-assembly-0.11.0-incubating.jar is absent.
[I= NFO] [Engine$] Going to run: /home/darshan/PredictionIO/sbt/sbt=C2=A0 = package assemblyPackageDependency in /home/darshan/PredictionIO/tapste= r-episode-similar
[ERROR] [Engine$] [error] /home/darshan/PredictionIO/t= apster-episode-similar/src/main/scala/DataSource.scala:63: not fo= und: value eventsDb
[ERROR] [Engine$] [error]=C2=A0=C2=A0=C2=A0=C2=A0 va= l viewEventsRDD: RDD[ViewEvent] =3D eventsDb.find(
[ERROR] [Engine$] [er= ror]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 ^
[ERROR] [Engine$] [error] one error found<= br>[ERROR] [Engine$] [error] (compile:compileIncremental) Compilation faile= d
[ERROR] [Engine$] [error] Total time: 5 s, completed 26 Jul, 2017 1:56= :50 AM
[ERROR] [Engine$] Return code of build command: /home/darshan/Pre= dictionIO/sbt/sbt=C2=A0 package assemblyPackageDependency is 1. Aborti= ng.
[INFO] [Engine$] Looking for an engine...
[INFO] [Engine$] Found = template-scala-parallel-similarproduct_2.10-0.1-SNAPSHOT.jar
[INFO]= [Engine$] Found template-scala-parallel-similarproduct-assembly-0.1-S= NAPSHOT-deps.jar
[INFO] [Engine$] Build finished successfully.
[= INFO] [Pio$] Your engine is ready for training.


and the file Dat= aSource.scala,


package org.example.similarproduct

import = org.apache.predictionio.controller.PDataSource
import org.apache.pr= edictionio.controller.EmptyEvaluationInfo
import org.apache.predict= ionio.controller.EmptyActualResult
import org.apache.predictionio.c= ontroller.Params
import org.apache.predictionio.data.storage.E= vent
import org.apache.predictionio.data.store.PEventStore

i= mport org.apache.spark.SparkContext
import org.apache.spark.SparkContext= ._
import org.apache.spark.rdd.RDD

import grizzled.slf4j.Log= ger

case class DataSourceParams(appName: String) extends Params
<= br>class DataSource(val dsp: DataSourceParams)
=C2=A0 extends PDataSourc= e[TrainingData,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EmptyEvaluationInfo, Quer= y, EmptyActualResult] {

=C2=A0 @transient lazy val logger =3D Logger= [this.type]

=C2=A0 override
=C2=A0 def readTraining(sc: SparkCont= ext): TrainingData =3D {

=C2=A0=C2=A0=C2=A0 // create a RDD of (enti= tyID, User)
=C2=A0=C2=A0=C2=A0 val usersRDD: RDD[(String, User)] =3D PEv= entStore.aggregateProperties(
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 appNam= e =3D dsp.appName,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 entityType =3D "u= ser"
=C2=A0=C2=A0=C2=A0 )(sc).map { case (entityId, properties) =3D= >
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val user =3D try {
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 User()
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } c= atch {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case e: Exception =3D&= gt; {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 logger.erro= r(s"Failed to get properties ${properties} of" +
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 s" user ${entit= yId}. Exception: ${e}.")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 throw e
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (entityId, = user)
=C2=A0=C2=A0=C2=A0 }.cache()

=C2=A0=C2=A0=C2=A0 // create a= RDD of (entityID, Item)
=C2=A0=C2=A0=C2=A0 val itemsRDD: RDD[(String, I= tem)] =3D PEventStore.aggregateProperties(
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 appName =3D dsp.appName,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 entityTyp= e =3D "item"
=C2=A0=C2=A0=C2=A0 )(sc).map { case (entityId, pr= operties) =3D>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val item =3D try {
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Assume categories is optional= property of item.
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Item(categ= ories =3D properties.getOpt[List[String]]("categories"))
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } catch {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 case e: Exception =3D> {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 logger.error(s"Failed to get properties ${pro= perties} of" +
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 s" item ${entityId}. Exception: ${e}.")
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 throw e
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (entityId, item)
=C2=A0=C2=A0=C2=A0 }.cache()
=C2=A0=C2=A0=C2=A0 // get all "user" "view" "= ;item" events
=C2=A0=C2=A0=C2=A0 val viewEventsRDD: RDD[ViewEvent] = =3D eventsDb.find(
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 appId =3D dsp.appId,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 entityType =3D Some("user"),
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 eventNames =3D Some(List("like")),=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // targetEntityType is optional field of= an event.
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 targetEntityType =3D Some(Some= ("item")))(sc)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // eventsDb.find= () returns RDD[Event]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .map { event =3D>= ;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val viewEvent =3D try {
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 event.event match {<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case = "like" =3D> ViewEvent(
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 user =3D event.entityId,
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= item =3D event.targetEntityId.get,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 t =3D event.eventTime.getMillis)=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case= _ =3D> throw new Exception(s"Unexpected event ${event} is read.&qu= ot;)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } catch {
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case e: Exception =3D> {
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 logger.error(s"= Cannot convert ${event} to ViewEvent." +
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 s" Exception: $= {e}.")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 throw e
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 viewEvent
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }.cache()
=C2=A0=C2=A0=C2=A0 new TrainingData(
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= users =3D usersRDD,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 items =3D itemsRDD,<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 viewEvents =3D viewEventsRDD
=C2=A0=C2= =A0=C2=A0 )
=C2=A0 }
}

case class User()

case class Ite= m(categories: Option[List[String]])

case class ViewEvent(user: Strin= g, item: String, t: Long)

class TrainingData(
=C2=A0 val users: R= DD[(String, User)],
=C2=A0 val items: RDD[(String, Item)],
=C2=A0 val= viewEvents: RDD[ViewEvent]
) extends Serializable {
=C2=A0 override = def toString =3D {
=C2=A0=C2=A0=C2=A0 s"users: [${users.count()} ($= {users.take(2).toList}...)]" +
=C2=A0=C2=A0=C2=A0 s"items: [${= items.count()} (${items.take(2).toList}...)]" +
=C2=A0=C2=A0=C2=A0 = s"viewEvents: [${viewEvents.count()}] (${viewEvents.take(2).toList}...)"
=C2=A0 }
}




while training, it gives= =C2=A0 me following error,




darshan@darshu:~/PredictionIO= /tapster-episode-similar/src/main/scala$ pio train
SLF4J: Clas= s path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:fi= le:/home/darshan/PredictionIO/lib/spark/pio-data-hdfs-assembly-0.= 11.0-incubating.jar!/org/slf4j/impl/StaticLoggerBinder.class]
= SLF4J: Found binding in [jar:file:/home/darshan/PredictionIO/lib/pio-a= ssembly-0.11.0-incubating.jar!/org/slf4j/impl/StaticLoggerBinder.= class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is = of type [org.slf4j.impl.Log4jLoggerFactory]
[WARN] [Template$] /hom= e/darshan/PredictionIO/tapster-episode-similar/src/main/scala/tem= plate.json does not exist. Template metadata will not be available. (This is safe=20 to ignore if you are not working on a template.)
Exception in thread &qu= ot;main" java.io.FileNotFoundException: /home/darshan/PredictionIO/tap= ster-episode-similar/src/main/scala/engine.json (No such file or = directory)
=C2=A0=C2=A0=C2=A0 at java.io.FileInputStream.open0(Nati= ve Method)
=C2=A0=C2=A0=C2=A0 at java.io.FileInputStream.open(FileI= nputStream.java:195)
=C2=A0=C2=A0=C2=A0 at java.io.FileInputStream.<i= nit>(FileInputStream.java:138)
=C2=A0=C2=A0=C2=A0 at scala.io.So= urce$.fromFile(Source.scala:90)
=C2=A0=C2=A0=C2=A0 at scala.io.Sour= ce$.fromFile(Source.scala:75)
=C2=A0=C2=A0=C2=A0 at org.apache.pred= ictionio.tools.console.Console$.getEngineInfo(Console.scala:724)<= br>=C2=A0=C2=A0=C2=A0 at org.apache.predictionio.tools.RunWorkflow$.ru= nWorkflow(RunWorkflow.scala:54)
=C2=A0=C2=A0=C2=A0 at org.apache.pr= edictionio.tools.commands.Engine$.train(Engine.scala:186)
=C2= =A0=C2=A0=C2=A0 at org.apache.predictionio.tools.console.Pio$.train(Pi= o.scala:85)
=C2=A0=C2=A0=C2=A0 at org.apache.predictionio.tools.console.Console$$anonfun$main$1.apply(Console.scala:626)
=C2=A0= =C2=A0=C2=A0 at org.apache.predictionio.tools.console.Console$$anonfun= $main$1.apply(Console.scala:611)
=C2=A0=C2=A0=C2=A0 at scala.Option= .map(Option.scala:145)
=C2=A0=C2=A0=C2=A0 at org.apache.predictioni= o.tools.console.Console$.main(Console.scala:611)
=C2=A0=C2=A0= =C2=A0 at org.apache.predictionio.tools.console.Console.main(Console.s= cala)



i tried almost all the things, but could not find= the proper solution. please help me...
i know you may feel bit od= d about this mail, but in need of your help.

thanks,

-DAN



--001a114dba4e038d26055548f2e1--