Posts

Rolling Out a Python Machine Learning Model to Production Using a Java based REST api

Motivation Once your data was prepared for Machine Learning algorithms, and your model is trained and fine-tuned. Now it is time to launch your solution. In the previous blog post , I focused on the steps presented above. Using python scikit-learn library, I showed you how to build a model. Now that the model is ready, how can you exposed the model knowledge to other applications? Approach This post presents the steps you should follow once you are ready to roll out a production deployment. To this end, I will expose the model using a REST api. But I will propose one more challenge. Beside the fact Python has great solutions to expose a REST api, imagine that you production environment allows you to deploy using only Java, as an example. The machine learning team has to be able to delivery a model which will be executed using a Java Virtual Machine. Exporting the Model The first  post  showed the steps to build model (xgb_clf). As you can see below, I am exporting the m

Using scikit-learn to tackle the Titanic Kaggle Competition

Image
Motivation This page contains walkthrough information written in python for the Titanic: Machine Learning from Disaster Titanic Code In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt from pandas.tools.plotting import scatter_matrix In [2]: # deterministic random data np . random . seed ( 42 ) In [3]: #Loading the training data train = pd . read_csv ( "train.csv" , index_col = "PassengerId" ) In [4]: train . info () #Some info are missing (age:714, cabin:204, embarked:889) <class 'pandas.core.frame.DataFrame'> Int64Index: 891 entries, 1 to 891 Data columns (total 11 columns): Survived 891 non-null int64 Pclass 891 non-null int64 Name 891 non-null object Sex 891 non-null object Age 714 non-null float64 SibSp 891 non-null int64 Parch