Songs Classifier is a project that consists of two parts.
- In
Data analysisyou 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 Appyou can find an app that usesStreamlit,mlflowandspotipyto allow users to classify songs from Spotify with trained Gradient Boosting Tree. Everything is running in containers.
cd data-analysis
docker compose upThe jupyter lab is available at localhost:8888.
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 upFrontend app is available at localhost:8080 and backend app (model) is available at localhost:5000.
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/bashChange 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.csvScript 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