Nick Buker
Deploying a simple machine learning model with a restful flask app.
- Clone this project to your local system
- Create and activate a virtual environment using Python >= 3.6
- Navigate to the root directory of this project and run the following command from the terminal
$ pip install -r requirements.txt
- The model endpoint can be launched the following command
$ python app.py
To launch the model endpoint in debug mode, add the --debug
argument
$ python app.py --debug
├── app.py
├── .gitignore
├── model_zoo/
│ └── iris/
│ ├── create_iris_model.py
│ ├── iris_api.py
│ ├── iris_data_schemas.py
│ ├── iris_model.joblib
│ └── iris_model_params.py
├── README.md
├── requirements.txt
└── test_query.py
app.py
- Launches flask app for the model API.gitignore
- Files and directories that should not be tracked by gitmodel_zoo/
- Stores modelsiris/
- Houses the iris model filescreate_iris_model.py
- Generates a trained logistic regression iris model and saves it asiris_model.joblib
iris_api.py
- API for iris modeliris_data_schemas.py
- Marshmallow schemas for model input and output datairis_model.joblib
- Trained logistic regression iris model generated bycreate_iris_model.py
iris_model_params.py
- Hyperparameters for the logistic regression iris model
requirements.txt
- Python packages required to run this projecttest_query.py
- Sends a POST request containing input data to the API and receives a model output response