Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MLOps series #1 : Batch scoring with Mlflow Model (Mleap flavor) on Google Cloud Platform
%sh
rm -rf /tmp/mleap_python_model_export
mkdir /tmp/mleap_python_model_export
ls -la /tmp/mleap_python_model_export
#Serialize Model to Bundle
lrModel.serializeToBundle("jar:file:/tmp/mleap_python_model_export/lrModel.zip", predictions)
%sh
ls -la /tmp/mleap_python_model_export/
dbutils.fs.cp("file:/tmp/mleap_python_model_export/lrModel.zip", "dbfs:/example/lrModel.zip")
display(dbutils.fs.ls("dbfs:/example"))
#Deserialize Model to Bundle
deserializedPipeline = PipelineModel.deserializeFromBundle("jar:file:/tmp/mleap_python_model_export/lrModel.zip")
#Score
exampleResults = deserializedPipeline.transform(abt_test)
display(exampleResults)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.