Skip to content

Deploying a simple machine learning model with a restful flask app.

Notifications You must be signed in to change notification settings

nickbuker/python_model_deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Model Deployment

Author

Nick Buker

Description

Deploying a simple machine learning model with a restful flask app.

Using this project

  1. Clone this project to your local system
  2. Create and activate a virtual environment using Python >= 3.6
  3. Navigate to the root directory of this project and run the following command from the terminal
$ pip install -r requirements.txt
  1. 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

Project structure

Tree

├── 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

Descriptions

  • app.py - Launches flask app for the model API
  • .gitignore - Files and directories that should not be tracked by git
  • model_zoo/ - Stores models
    • iris/ - Houses the iris model files
      • create_iris_model.py - Generates a trained logistic regression iris model and saves it as iris_model.joblib
      • iris_api.py - API for iris model
      • iris_data_schemas.py - Marshmallow schemas for model input and output data
      • iris_model.joblib - Trained logistic regression iris model generated by create_iris_model.py
      • iris_model_params.py - Hyperparameters for the logistic regression iris model
  • requirements.txt - Python packages required to run this project
  • test_query.py - Sends a POST request containing input data to the API and receives a model output response

About

Deploying a simple machine learning model with a restful flask app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages