Commit 5eb0e117402b4cdd6fe700fd6db27dc141584c6f
1 parent
783fe3a33d
Exists in
master
hue csv save
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
app/com/piki_ds/ver2ggh/gghScore.scala
View file @
5eb0e11
... | ... | @@ -155,15 +155,16 @@ |
155 | 155 | val gghStd = gghVer3.describe().where("summary = 'stddev'").drop("summary").take(1)(0)(4).toString.toDouble |
156 | 156 | |
157 | 157 | val gghScaled = gghVer3.withColumn("gghScaled", (column("ggh") - gghMean) / gghStd).selectExpr("*", "1000 / (1 + exp(-gghScaled)) as scaledGgh").drop("gghScaled") |
158 | -/* | |
158 | + | |
159 | 159 | gghScaled.map{x => |
160 | 160 | s"${x(0)},${x.getAs[Double]("scaledGgh").toInt}" |
161 | 161 | }.saveAsTextFile(s"hdfs://pikinn/preprocess/timelineScore/content/ggh/$saveDay") |
162 | -*/ | |
162 | + | |
163 | 163 | val finalScore = gghScaled.map(x=>(x(0),x.getAs[Double]("scaledGgh").toInt)) |
164 | 164 | val insertArray = finalScore.map(x=>(x._1.toString, x._2.toString)).collect() |
165 | 165 | val test = new HbaseInserter("cid_ggh2") |
166 | 166 | test.insert(insertArray) |
167 | + | |
167 | 168 | /*//////// CTR and CTR Time 계산 |
168 | 169 | val ctr = expConsume.groupBy("cid"). |
169 | 170 | agg(expr("sum(expTime1) as expTime1"), expr("sum(expSize1) as expSize1"), expr("sum(expTime2) as expTime2"), |