From dca1584aece4e47d38468617b64e47b601167e84 Mon Sep 17 00:00:00 2001 From: Joanne Date: Thu, 27 Oct 2016 11:35:26 +0900 Subject: [PATCH] debug --- app/com/piki_ds/ver1/EditorScore.scala | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/app/com/piki_ds/ver1/EditorScore.scala b/app/com/piki_ds/ver1/EditorScore.scala index 2d9a267..a5db7a4 100644 --- a/app/com/piki_ds/ver1/EditorScore.scala +++ b/app/com/piki_ds/ver1/EditorScore.scala @@ -137,9 +137,9 @@ object EditorScore { val performanceRaw: RDD[(Long, ((Long, Long, Long, Long, Long), Int))] = cPDB.groupBy(_._1).map(x=> { val innerSum: (Long, Long, Long, Long, Long) = x._2.map(a => { - (a._2("view").replaceAll("^$", "0").toLong, a._2("likes").replaceAll("^$", "0").toLong, - a._2("share").replaceAll("^$", "0").toLong, a._2("bookmark").replaceAll("^$", "0").toLong, - a._2("comment").replaceAll("^$", "0").toLong) + (a._2("view").replaceAll("^$", "0").toDouble.toLong, a._2("likes").replaceAll("^$", "0").toDouble.toLong, + a._2("share").replaceAll("^$", "0").toDouble.toLong, a._2("bookmark").replaceAll("^$", "0").toDouble.toLong, + a._2("comment").replaceAll("^$", "0").toDouble.toLong) }).reduce((a,b)=>(a._1+b._1, a._2+b._2, a._3+b._3, a._4+b._4, a._5+b._5)) (x._1, innerSum) }).join(uidAndContents) @@ -166,16 +166,6 @@ object EditorScore { }) val performance = make_0to1(sumPerformance) - /* - val performance: RDD[(String, Double)] = minMaxPerformance.map(x=>{ - val score = tr_Weibull(x._2._1.toDouble, 1, 0.5)+ - tr_Weibull(x._2._2.toDouble, 1, 0.5)+ - tr_Weibull(x._2._3.toDouble, 1, 0.5)+ - tr_Weibull(x._2._4.toDouble, 1, 0.5)+ - tr_Weibull(x._2._5.toDouble, 1, 0.5) - (x._1, score/5) - }) -*/ val finalScore = ePopularity.map(x=>{ -- 1.8.5.2