Let’s update the following page to also include code snippets in pysparkling and scala on how to get the prediction contributions from an already existing mojo.
Here is an example for pysparkling:
from pysparkling.ml import *
path = '/Users/laurend/GBM_model_python_1567046427048_53.zip' # path to my mojo
settings = H2OMOJOSettings(withDetailedPredictionCol=True)
model = H2OMOJOModel.createFromMojo(path, settings)
predictions = model.transform(testingDF) # testingDF is type pyspark.sql.dataframe.DataFrame