Skip to content

anras5/songs-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Songs Classifier

Songs Classifier is a project that consists of two parts.

  • In Data analysis you can find Jupyter notebook with data analysis of the dataset and a lot of insights into how the data looks like and how the machine learning models were trained.
  • In Classifier App you can find an app that uses Streamlit, mlflow and spotipy to allow users to classify songs from Spotify with trained Gradient Boosting Tree. Everything is running in containers.

How to run?

Data analysis

cd data-analysis
docker compose up

The jupyter lab is available at localhost:8888.

Classifier App

Create a .env file inside the classifier-app/frontend directory with the same structure as .env.example. Get your own Spotify credentials from Spotify Developers Website.

cd classifier-app
docker compose up

Frontend app is available at localhost:8080 and backend app (model) is available at localhost:5000.

Develop backend (if you want to change the model)

cd classifier-app/backend
docker build -f develop.dockerfile -t mlflow-develop-image .
docker run -it -v "${PWD}:/app" -p 5000:5000 --rm mlflow-develop-image /bin/bash

Change the ${PWD} to $(pwd) if you are on Linux. If you have already built the image in the past skip the second command.

Run the training

python3 src/train.py --file_path=/app/data/dataset_cleaned.csv

Script prints out runid at the end.

Serve the model

mlflow models serve --model-uri runs:/<runid>/GradBoostClassifier --no-conda -p 5000 -h 0.0.0.0

How does the app look like?

image

Releases

No releases published

Packages

No packages published

Languages