Commit dca1584aece4e47d38468617b64e47b601167e84
1 parent
be098b973b
Exists in
master
debug
Showing 1 changed file with 3 additions and 13 deletions Side-by-side Diff
app/com/piki_ds/ver1/EditorScore.scala
View file @
dca1584
... | ... | @@ -137,9 +137,9 @@ |
137 | 137 | |
138 | 138 | val performanceRaw: RDD[(Long, ((Long, Long, Long, Long, Long), Int))] = cPDB.groupBy(_._1).map(x=> { |
139 | 139 | val innerSum: (Long, Long, Long, Long, Long) = x._2.map(a => { |
140 | - (a._2("view").replaceAll("^$", "0").toLong, a._2("likes").replaceAll("^$", "0").toLong, | |
141 | - a._2("share").replaceAll("^$", "0").toLong, a._2("bookmark").replaceAll("^$", "0").toLong, | |
142 | - a._2("comment").replaceAll("^$", "0").toLong) | |
140 | + (a._2("view").replaceAll("^$", "0").toDouble.toLong, a._2("likes").replaceAll("^$", "0").toDouble.toLong, | |
141 | + a._2("share").replaceAll("^$", "0").toDouble.toLong, a._2("bookmark").replaceAll("^$", "0").toDouble.toLong, | |
142 | + a._2("comment").replaceAll("^$", "0").toDouble.toLong) | |
143 | 143 | }).reduce((a,b)=>(a._1+b._1, a._2+b._2, a._3+b._3, a._4+b._4, a._5+b._5)) |
144 | 144 | (x._1, innerSum) |
145 | 145 | }).join(uidAndContents) |
... | ... | @@ -166,16 +166,6 @@ |
166 | 166 | }) |
167 | 167 | |
168 | 168 | val performance = make_0to1(sumPerformance) |
169 | - /* | |
170 | - val performance: RDD[(String, Double)] = minMaxPerformance.map(x=>{ | |
171 | - val score = tr_Weibull(x._2._1.toDouble, 1, 0.5)+ | |
172 | - tr_Weibull(x._2._2.toDouble, 1, 0.5)+ | |
173 | - tr_Weibull(x._2._3.toDouble, 1, 0.5)+ | |
174 | - tr_Weibull(x._2._4.toDouble, 1, 0.5)+ | |
175 | - tr_Weibull(x._2._5.toDouble, 1, 0.5) | |
176 | - (x._1, score/5) | |
177 | - }) | |
178 | -*/ | |
179 | 169 | |
180 | 170 | |
181 | 171 | val finalScore = ePopularity.map(x=>{ |