Deploy your PMML models to production in under two minutes

Prakash Gupta
3 min readApr 10, 2020

Today numerous platforms and frameworks support exporting models to PMML format, making it easier to deploy and integrate these models with other applications.

Analytics platforms like Alteryx, RapidMiner, SaS, Dataiku have a direct way of exporting trained models in PMML. Models built using open source libs like sklearn, xgboost, lightGBM, etc, can also be exported to PMML using libraries like nyoka.

Today we will see how PMML model can be deployed (to AWS / GCP / Azure / local machine) in couple of minutes.

Setup needed

  • Active Clouderizer account. Signup here if you don’t have one already.
  • PMML model file for a trained model. I will be using a PMML v4.0 model trained on Iris dataset from DMG website here.

Deploying Model

  • Login to your clouderizer account here.
  • After login, go to Showcase tab and press “New Project” and give the project a name — “IrisRandomForrest”
  • Select “PMML” and press Next. Upload your PMML model and press Finish.
  • This will start uploading your model to Clouderizer. Post upload, Clouderizer will parse your model and detect input and output parameters for your model. Press Save.
  • Model is now ready to be deployed. Press the Deploy button on top right corner. This will allow you to select where you wish to deploy. You can choose to deploy on AWS or GCP or local mac / ubuntu machines.
  • For Mac / Ubuntu, you will get a bash script. Copy that script and paste and run it on your local machine terminal.

Please note Docker is a pre-requisite to run Showcase projects locally on Ubuntu or Mac machines

  • Showcase project will now show deploying status with progress. it normally takes couple of minutes to deploy the model (it might be more if run first time on local machine as it needs to download docker image first)
  • Once done, you will see Showcase URL on bottom left corner of screen. This is the URL where your model is hosted.
  • Your PMML model is now deployed. It can be accessed via
  1. REST Apis. Sample client code for accessing these REST endpoints is available from bottom right corner of Showcase project page.

2. Using Clouderizer’s dynamically generated Web UI front end.

  • Showcase URL for Web UI frontend can be shared with anyone to try out the model. Users have an option to give feedback about how they feel about model prediction. Bulk prediction using CSV file is also available in this UI.
  • Clouderizer saves all inputs / scored outputs in a scalable time series database. You can view the list of all input from Showcase project page -> Analytics. Useful trends like response time, # of requests per day can be easily visualised here

Feel free to try Clouderizer Showcase for your model deployment and in case you have any query, you can write to us at info@clouderizer.com

--

--

Prakash Gupta

Passionate about designing and developing scalable software platforms.