Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # load mojo model and create easy predict model wrapper
- val mojo = MojoModel.load("loca/path/to/mojo/mojo.zip")
- val easyModel = new EasyPredictModelWrapper(mojo)
- # map over spark DataFrame, converty to rdd, and make predictions on each row:
- df.rdd.map { row =>
- val prediction = easyModel.predictBinomial(row).classProbabilities
- println(prediction)
- }
Add Comment
Please, Sign In to add comment