aws / sagemaker-sparkml-serving-container

This code is used to build & run a Docker container for performing predictions against a Spark ML Pipeline.
Apache License 2.0
50 stars 25 forks source link

Prediction Probability from mleap model deployed on sagemaker #13

Open janvekarnaveed opened 4 years ago

janvekarnaveed commented 4 years ago

After deploying mleap model artifact on sagemaker endpoint, during the inferencing stage, how can I get probabilities of prediction rather than binary outcome? I tried changing output column from prediction to probability, but I get the following error: sagemaker: ml.combust.mleap.tensor.DenseTensor cannot be cast to java.lang.Double

Any suggestions?

orchidmajumder commented 4 years ago

As far I can tell, you need to change your SparkML Pipeline to return probabilities rather than the outcome and then it can be successfully cast into the DenseTensor object.

janvekarnaveed commented 4 years ago

Thanks for the comments, Orchid! I am trying to find documentation around pipeline models returning proababilities, unable to find any good source. Would you happen to have any examples of any spark classification model deployed on sagemaker that returns probabilities?