|
@@ -147,16 +147,18 @@ object recsys_01_ros_reg_xgb_train {
|
|
val vid = JSON.parseObject(rList(2)).getString("vid")
|
|
val vid = JSON.parseObject(rList(2)).getString("vid")
|
|
val label = rList(0).toDouble
|
|
val label = rList(0).toDouble
|
|
val score = rList(1).toDouble
|
|
val score = rList(1).toDouble
|
|
- (vid, (1, score, RosUtil.inverseLog(score)))
|
|
|
|
|
|
+ (vid, (1, label, RosUtil.inverseLog(label), score, RosUtil.inverseLog(score)))
|
|
}).reduceByKey {
|
|
}).reduceByKey {
|
|
case (c1, c2) => (
|
|
case (c1, c2) => (
|
|
c1._1 + c1._1,
|
|
c1._1 + c1._1,
|
|
c2._2 + c2._2,
|
|
c2._2 + c2._2,
|
|
- c2._3 + c2._3
|
|
|
|
|
|
+ c2._3 + c2._3,
|
|
|
|
+ c2._4 + c2._4,
|
|
|
|
+ c2._5 + c2._5
|
|
)
|
|
)
|
|
}.map {
|
|
}.map {
|
|
- case (vid, (all, sumScore, sumScore2)) =>
|
|
|
|
- (vid, (all, sumScore, sumScore / all, sumScore2, sumScore2 / all))
|
|
|
|
|
|
+ case (vid, (all, label, originLabel, score, originScore)) =>
|
|
|
|
+ (vid, (all, label / all, score / all, originLabel / all, originScore / all))
|
|
}
|
|
}
|
|
.collect()
|
|
.collect()
|
|
.sortBy(_._1)
|
|
.sortBy(_._1)
|