File tree Expand file tree Collapse file tree
tutorials/sparkling-water Expand file tree Collapse file tree Original file line number Diff line number Diff line change 225225 idfModel : IDFModel ,
226226 h2oContext : H2OContext ,
227227 hamThreshold : Double = 0.5 ): String = {
228- val msgRdd = sc.parallelize(Seq (msg))
229- val msgVector : DataFrame = idfModel.transform(
230- hashingTF.transform (
231- tokenize (msgRdd))).map(v => SMS (" ?" , v)).toDF
232- val msgTable : H2OFrame = h2oContext.asH2OFrame(msgVector)
233- msgTable.remove(0 ) // remove first column
234- val prediction = dlModel.score(msgTable)
235-
236- if (prediction.vecs()(1 ).at(0 ) < hamThreshold) " SPAM DETECTED!" else " HAM"
228+ val msgRdd = sc.parallelize(Seq (msg))
229+ val msgVector : DataFrame = idfModel.transform(
230+ hashingTF.transform (
231+ tokenize (msgRdd))).map(v => SMS (" ?" , v)).toDF
232+ val msgTable : H2OFrame = h2oContext.asH2OFrame(msgVector)
233+ msgTable.remove(0 ) // remove first column
234+ val prediction = dlModel.score(msgTable)
235+
236+ if (prediction.vecs()(1 ).at(0 ) < hamThreshold) " SPAM DETECTED!" else " HAM"
237237 }
238238 ```
239239
You can’t perform that action at this time.
0 commit comments