Machine Learning Model for Insurance Fraud : Deployment made easy using Clouderizer
By: Rohan Kothapalli
Tags: Deployment, Artificial Intelligence, Deep Learning, Python, Machine Learning

Try out the deployed model now :

https://serverless.clouderizer.com/function/clouderizerdemo-autoinsurancefrauddetection

Imagine, for a moment, receiving lower auto insurance rates. Year after year. For the same coverage. What’s the catch? Fraud getting caught more often!

Nowadays, when actuarial science meets computer science, machine learning (ML) models spring up to slash insurance fraud. But for that to happen, these ML models have to be first deployed.

Which brings us to Clouderizer — an easy to use ‘ML Ops’ platform that can quickly serve up a prediction using an ML model (in this case, about auto insurance fraud).

Traditionally, the challenging problem of fraud detection has relied heavily on manual auditing and expert inspection. Which are costly, inefficient and counter-productive to providing lower rates. The scale of the problem is significant as an estimated 21%–36% of auto-insurance claims contain elements of suspected fraud.

Deployed ML models are effective predictive methods which can maximize the true positive detection rate, minimize the false positive rate, and are able to quickly identify new and emerging fraud schemes.

We took up this challenge to build a simple machine learning model which detects whether an insurance claim is fraud/not. The dataset is readily available from Kaggle and the model was built using H2oAutoML for python, XGBoost algorithm. The H2oAutoML module neatly converts the model into a zip format. The zip file can be obtained by running the training notebook on github. Github for training part!

In this article we’ll demonstrate how you can use Clouderizer to deploy practically any commonly developed ml model.

Model deployment

Model deployment is a completely different ball game than model development. Data scientists typically hand over their model to engineering for implementing a secure, reliable and scalable deployment. It would be great to have a URL with a neat interface to score the model. Anyone can open the url and run the prediction with their inputs. That’s where Clouderizer comes into picture. Clouderizer can help check off all these boxes and more. Clouderizer gives you all the controls and features you need for easily creating an API, delivering an out of the box intuitive web interface with an intuitive analytics dashboard, debugging any potential runtime errors early on, updating your deployments with zero downtime, performing the desired preprocessing and postprocessing, , retraining your model (either manually or automatically depending on your error metric). reliably maintaining your deployments.

Here are the Clouderizer screenshots that back up the above claims.

Go to Clouderizer.

Documentation to navigate through the platform.

Steps:

1.Create a new project,

2. Select h2o/dai project type and upload the auto_insurance_fraud.zip file we obtained from running the training.

3. After the model file is uploaded, the input and output attributes are automatically set.

The output by model is binary i.e 1 in case of “Fraud” and 0 for “Not Fraud”. People who might try out the model have no idea what those binary outputs mean. We don’t want to go through training the whole model again just to change the output variable names. That’s where the Postprocessing feature comes in. The feature can be enabled by clicking on the “Settings” button. Tick the post processing box and click “Save”.

When post processing is enabled, instead of directing model output to the user, the platform directs it to a simple python postprocessor function.

Hence, the model flow gets updated automatically with the postprocessing step. In postprocessing we want the model to output “FRAUD”/”NOT FRAUD” instead of 1/0. To achieve this Showcase provides a python postprocessor function, with the input from the h2o model output i.e 1/0. Click on the “Postprocess Code” button to prepare your postprocessing/display code.

The input variable is already defined and given to the user in the form of comments. As seen in the post process code, we get the probability output from the h2o model. If the p>0.5 → It’s a fraud and <0.5 “not a fraud”. Whatever output we want the scoring user to see instead of technically accurate probabilities that badly need a fix for their low expressiveness can be written here. After adding the post process, the output is no longer the model output. It is instead the output from post processor. So we need to change the “Output details” accordingly.

The model deployment setup is now complete. For deployment, click the “Deploy button”. The model can be deployed on various infrastructures depending on your requirements. Choose the suitable deployment options and your model should be ready to score in under 4 minutes.

Once deployment is complete, you will find a url to your project on the bottom left. This url will take us to your model serving page where you can score the model with a simple UI.

This url can be shared with anyone over the internet. People with access to the url can score, review, collaborate and make updates to the model with a simple interface. The creator of the project will have access to the analytics section where all the data about previous inferences, response time, error metrics, feedback and model failure points can be checked.

This image refers to the analytics page. It contains data of each reference ever made for this model with timestamp, inputs and outputs. On clicking More Details respective to each inference, exact inputs and outputs scored by random users who have access to the url.

CONCLUSION:

Clouderizer provides a platform to reliably deploy, showcase and scale your machine learning model.

Deployed model : https://serverless.clouderizer.com/function/clouderizerdemo-autoinsurancefrauddetection