- Origin
- Author: Heber Trujillo heber.trj.urt@gmail.com
- Date of last README.md update: 23.04.2022
This repository shows how to Deploy an end-to-end machine learning (ML) pipeline using FastAPI and Heroku.
The following directional graph shows the implemented ML-pipeline:
Which contains the following components:
- prepare: preprocess the census data.
- segregate: Segregates the data into test and training sets.
- train: Trains a classification inference artifact.
- evaluate: Test the fitted inference artifact.
-
Create and activate a virtual environment for the project. For example:
python3 -m venv ./.venv source ./.venv/bin/activate
-
Install Poetry, the tool used for dependency management. To install it, run from a terminal:
pip install poetry
-
From the virtual environment, install the required dependencies with:
poetry install --no-root
The ML-pipeline can be executed:
dvc repro
Type the following command to run the live server locally:
uvicorn main:app --reload
Now go to http://127.0.0.1:8000/docs
You will see the automatic interactive API documentation:
The API has two endpoints, as shown in the API documentation.
The root domain contains a greeting and a helpful link where you can check the model card:
This endpoint performs inference on new data: