Commit 783fe3a33d5a3b22595231d4812b96eefbf76932

Authored by Joanne ago
1 parent d74fa3aabe
Exists in master

temp insert

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

app/com/piki_ds/ver2ggh/gghScore.scala View file @ 783fe3a
... ... @@ -155,11 +155,11 @@
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")