Guest User

Untitled

a guest
Dec 15th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. # load mojo model and create easy predict model wrapper
  2. val mojo = MojoModel.load("loca/path/to/mojo/mojo.zip")
  3. val easyModel = new EasyPredictModelWrapper(mojo)
  4.  
  5. # map over spark DataFrame, converty to rdd, and make predictions on each row:
  6. df.rdd.map { row =>
  7. val prediction = easyModel.predictBinomial(row).classProbabilities
  8. println(prediction)
  9. }
Add Comment
Please, Sign In to add comment