predictionio-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject incubator-predictionio-template-recommender git commit: Fix use of case class
Date Sat, 15 Jul 2017 16:40:28 GMT
Repository: incubator-predictionio-template-recommender
Updated Branches:
  refs/heads/develop 5cadb5e3b -> 044f842b0


Fix use of case class

Closes #18


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/commit/044f842b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/tree/044f842b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/diff/044f842b

Branch: refs/heads/develop
Commit: 044f842b0208c28c88da20858f6b3235d1502f39
Parents: 5cadb5e
Author: Naoki Takezoe <takezoe@apache.org>
Authored: Sun Jul 16 01:39:45 2017 +0900
Committer: Naoki Takezoe <takezoe@apache.org>
Committed: Sun Jul 16 01:39:45 2017 +0900

----------------------------------------------------------------------
 src/main/scala/ALSAlgorithm.scala | 4 ++--
 src/main/scala/Engine.scala       | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/blob/044f842b/src/main/scala/ALSAlgorithm.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/ALSAlgorithm.scala b/src/main/scala/ALSAlgorithm.scala
index f99e525..bc2b7b1 100644
--- a/src/main/scala/ALSAlgorithm.scala
+++ b/src/main/scala/ALSAlgorithm.scala
@@ -84,10 +84,10 @@ class ALSAlgorithm(val ap: ALSAlgorithmParams)
       // index. Convert it to String ID for returning PredictedResult
       val itemScores = model.recommendProducts(userInt, query.num)
         .map (r => ItemScore(itemIntStringMap(r.product), r.rating))
-      new PredictedResult(itemScores)
+      PredictedResult(itemScores)
     }.getOrElse{
       logger.info(s"No prediction for unknown user ${query.user}.")
-      new PredictedResult(Array.empty)
+      PredictedResult(Array.empty)
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/blob/044f842b/src/main/scala/Engine.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Engine.scala b/src/main/scala/Engine.scala
index bbec828..71e09bf 100644
--- a/src/main/scala/Engine.scala
+++ b/src/main/scala/Engine.scala
@@ -6,20 +6,20 @@ import org.apache.predictionio.controller.Engine
 case class Query(
   user: String,
   num: Int
-) extends Serializable
+)
 
 case class PredictedResult(
   itemScores: Array[ItemScore]
-) extends Serializable
+)
 
 case class ActualResult(
   ratings: Array[Rating]
-) extends Serializable
+)
 
 case class ItemScore(
   item: String,
   score: Double
-) extends Serializable
+)
 
 object RecommendationEngine extends EngineFactory {
   def apply() = {


Mime
View raw message