Skip to main content

1. Build your Model

You must first create a machine learning model to deploy Modelify. To demonstrate usage, we will build a simple model using the Iris dataset, which is the most widely known in data science. If you have a model that you created before, you can skip this step. Currently, Modelify supports most of frameworks. You can find the supported models in the document here.

import numpy as np
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
import sklearn.linear_model as glm

# load dataset
iris = load_iris()
df= pd.DataFrame(data= np.c_[iris['data'], iris['target']],
columns= iris['feature_names'] + ['target'])

# train-test split
train, test = train_test_split(df, test_size=0.2 )
y_train = df["target"]
X_train = df.drop(columns=["target"])

# fit model
model = glm.LogisticRegression()
model.fit(X_train, y_train)

We have now created a Logistic Regression model using the Iris dataset. After this stage, we will be able to use the Modelify library.