Skip to content

Instantly share code, notes, and snippets.

@IvanNardini
Created June 7, 2020 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IvanNardini/dfbf861f560621b838e489e2430482d0 to your computer and use it in GitHub Desktop.
Save IvanNardini/dfbf861f560621b838e489e2430482d0 to your computer and use it in GitHub Desktop.
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