Welcome to the Music Recommendation System project! This project is designed to provide users with recommendations for music albums and songs based on their preferences. Users can register, log in, and interact with a collection of albums and songs.
![Image 1](https://private-user-images.githubusercontent.com/85384973/266765352-4daf050a-bb01-4fea-989f-cc32e861d7e0.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzODAwNjUsIm5iZiI6MTcyNDM3OTc2NSwicGF0aCI6Ii84NTM4NDk3My8yNjY3NjUzNTItNGRhZjA1MGEtYmIwMS00ZmVhLTk4OWYtY2MzMmU4NjFkN2UwLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIzVDAyMjI0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiODRiNTE4MTBhM2Q3MTMzZTc5N2VlMjhhZDY5ZjNmY2E3ZGYwNDc3NDBhNzllNzI0YWEwMjBjYTU5MWIxZDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.-qhP08LlWAf37uYvP_oNljSZWyCfqmKEyE3sTPPFw8Q)
- User Registration: Users can create accounts with their name, email, password, and UID.
- User Authentication: Registered users can log in securely.
- Music Library: Explore a collection of music albums and songs.
- Liked Songs: Users can like and unlike songs, and their preferences are stored.
- Recommendation Engine: Provides music recommendations based on user interactions.
Follow these instructions to set up and run the Music Recommendation System on your local machine.
-
Clone the repository:
git clone https://github.com/yourusername/music-recommendation-system.git
-
Install the required dependencies:
# Navigate to the project directory cd music-recommendation-system # Install dependencies (e.g., PHP, MySQL, Apache) # Set up your web server to serve the project
-
Set up the database:
- Import the
database.sql
file into your MySQL database. This file contains the schema and initial data.
- Import the
-
Configure the database connection:
- Open the
database.php
file and update the database connection settings (e.g., hostname, username, password).
- Open the
-
Start your web server (e.g., Apache) and navigate to the project in your web browser.
-
You can now register an account, log in, and explore the music library.
- Register an account with a valid email, name, and UID.
- Log in with your registered email and password.
- Explore the music library to discover albums and songs.
- Like and unlike songs to improve music recommendations.
The database for this project is structured as follows:
albums
: Stores information about music albums.artists
: Contains data about music artists.liked_songs
: Records user likes and dislikes for songs.songs
: Stores details about individual songs.users
: Manages user accounts and profiles.
Refer to the database.sql
file for the complete database schema and initial data.
The algorithm is referred to as the "Song Similarity and Ranking Algorithm." This algorithm is a crucial component of the Music Recommendation System (RecomMuse) described in the paper. Its primary purpose is to calculate the similarity between pairs of songs based on various factors and then rank these songs by their combined similarity scores. Below, I'll explain this algorithm in more detail:
-
Input Data: The algorithm requires access to specific database tables, including "users," "songs," and "liked_songs." These tables store information about users, songs, and user interactions, such as liking and unliking songs.
-
Initialization: The algorithm begins by initializing an empty list to store song objects along with their respective combined similarity scores.
-
Iterating Over Song Pairs: For each unique pair of songs (s1, s2) retrieved from the "songs" table, the algorithm performs the following steps:
a. Genre Similarity Calculation: It calculates the similarity component for song genres (genre_similarity). This involves counting the number of common genres between s1 and s2 and then dividing it by the total number of unique genres between these songs.
b. Language Similarity Calculation: Similar to genre similarity, it calculates the language similarity component (language_similarity) based on the commonality of song languages.
c. User Liking Similarity Calculation: This step considers user interactions. It retrieves the list of users who liked and unliked s1 and s2 from the "liked_songs" table. It calculates the number of common users who liked s1 and unliked s2, as well as the number of common users who liked s2 and unliked s1. These are used to compute the liking similarity component (liking_similarity).
d. User Unliking Similarity Calculation: Similar to liking similarity, this step calculates the unliking similarity component (unlike_similarity) based on common users who unliked s1 and s2.
e. Combined Similarity Score: The algorithm combines these similarity components using specified weights (e.g., 0.4 for genre, 0.2 for language, 0.4 for liking, and 0.2 for unliking). The combined similarity score (combined_similarity) for the song pair (s1, s2) is computed as a weighted sum of these components.
f. Update Song Objects: For each song s1, a song object is created (if not already created), and its combined similarity score is updated by adding the computed combined_similarity value.
-
Ranking Songs: Once all song pairs have been processed, the algorithm sorts the list of song objects by their combined similarity scores in descending order. This results in a ranked list of songs, where songs with higher combined similarity scores appear at the top.
-
Output: The algorithm returns the ranked list of songs as its output. In summary, this algorithm plays a crucial role in the RecomMuse Music Recommendation System by calculating the similarity between songs based on genre, language, user liking, and user unliking behaviors. It then ranks these songs by their combined similarity scores, allowing the system to provide personalized and relevant music recommendations to users. The use of collaborative filtering and content-based features contributes to a more comprehensive and adaptable recommendation system.
Contributions are welcome! Feel free to open issues or pull requests to improve this project.