Ever try to use the random functionality on your phone when you're playing songs only to skip the songs you didn't like anyways because you don't know what you like but you do know what you don't like for sure? This model is for that This project implements a model that recommends songs using reinforcement learning. The model aims to enhance the user's listening experience by minimizing the number of skipped songs.
The states in this model represent the currently playing song.
The actions correspond to the songs that have not yet been played.
The reward mechanism is simple: if the song is not skipped,1 is given; otherwise, 0 is assigned.
The training process involves modeling the list of songs using
During the training, we compare the performance of two algorithms:
- Q-Learning
- Average State Values Algorithm
Create a spotify developer act to access their api then clone the repo using
git clone https://github.com/Amine-Zitoun/Music_Recommender_RL
then intall the requirements
python install -m requirements.txt
then run the script
python agent.py
you'll get the following
Made By zitoun
-tr to see how the model trained more about that in readme.md
-f to fine tune epsilon or alpha
-test to test the model
enter mode:
-
Training Mode:
- This mode is used to train the model and visualize the comparison between Q-Learning and Average State Values.
- Usage:
enter mode : -tr
- Output: Generates
q_algo.png
showing the performance comparison.
-
Fine-Tuning Mode:
-
This mode is used for fine-tuning the model.
-
Usage:
enter mode : -f
-
Output: Generates
epsilon.png if mode "e"
andlearning_rate.png if mode "a"
to visualize the effect of different epsilon values and learning rates.
-
-
Testing Mode:
- This mode is used to test the trained model in a real-world scenario.
- Usage:
enter mode : test
- This mode allows you to experience the model's performance live.
- Discord Bot can build a discord bot using python and detect the spotify activity of a user and then use the spotify api to skip
- Android App build an android app using kivy or tkinter and detect when the song is playing on phone and skip when needed
# Train the model and compare algorithms
enter mode : -tr
# Fine-tune the model
enter mode: -f
# Test the model in real-world scenarios
enter mode: -test
By following the steps outlined above, you can train, fine-tune, and test the song recommendation model to achieve the best performance in minimizing skipped songs and enhancing the user's listening experience.