Deploying machine learning models to localhost
We'll have to train a model before we can deploy it. You already know everything about training with TPOT, so we won't spend too much time here. The goal is to train a simple Iris classifier and export the predictive functionality somehow. Let's go through the process step by step:
- As always, the first step is to load in the libraries and the dataset. You can use the following piece of code to do so:
import pandas as pd df = pd.read_csv('data/iris.csv') df.head()
This is what the first few rows look like:
- The next step is to separate the features from the target variable. This time, we won't split the dataset into training and testing subsets, as we don't intend to evaluate the model's performance. In other words, we know the model performs well, and now we want to retrain it on the entire dataset. Also, string values in the target...