Skip to content

daniel-lujan/income-prediction-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Income Prediction API

FastAPI Python scikit-learn NumPy Pandas

Important

This is a project for academic purposes.

This application serves a Machine Learning model to predict wether a person has yearly earnings above 50K USD or not. Trained with the public Census Income dataset from UCI ML repo.

Model accuracy is around 82.7%.

For more information about data exploration, preprocessing, training iterations and model accuracy, see the Jupyter Notebooks repository.

Quickstart

Creating virtual environment

Note

This is not a required step, although it is highly recommended to use a virtual environment to avoid incompatibility issues with required packages.

# or pip3
pip install virtualenv
# or python3
python -m venv venv
# or source /venv/bin/activate
./venv/Scripts/activate

Installing dependencies

# or pip3
pip install -r requirements.txt

Run the server

# or pip3
fastapi run

You can then see the available endpoint documentation at http://localhost:8000/docs and try requests from there.