/CensusClassifier

Primary LanguagePythonOtherNOASSERTION

Introduction

A machine learning model to predict salary range deployed in render with a public API.

  • See model card to read about the model and the ethical considerations.
  • See usage to use the features of the repository

Links

  • Repository
  • WandB for viewing experiments and exploratory data analysis code artifacts

Results

  • View summary of model metrics in WandB
  • View model slices output in WandB table

Usage

Making predictions using HTTP requests on Render

App is deployed on Render and you may try it out by using Postman or any other tool of your convenience. A sample usage is in live_post_request.py App is available at: https://census-classifier-api.onrender.com/

Using CensusClassifier as a library

Requirements

WandB account, as we will log model metrics using WandB

Installation

pip install -r requirements.txt
# Optional for downloading EDA notebook
wandb artifact get abdulazizab/census-classification/job-https___github.com_abdulazizab2_CensusClassifier.git_explore_census_dataset.ipynb:latest
dvc pull # fetches data and model

Training

PYTHONPATH=. python CensusClassifier/train_model.py

After training a new model, you can version it by:

dvc add model/{YOUR_MODEL}
dvc add model/{YOUR_ENCODER}

And push it to your remote !

Inference

  1. Launch API server
uvicorn main:app
  1. View docs at {IP}:{PORT}/docs on how to make inference using /predict

Unit Tests

PYTHONPATH=. pytest