The Music-Based User Matchmaking System is a project aimed at connecting individuals through shared music preferences. In a world where digital interactions often overshadow personal connections, this system leverages music as a universal language to foster genuine relationships. By analyzing user listening habits and preferences, the system provides personalized music recommendations and identifies users with similar tastes, enhancing social connectivity.
The architecture of this system consists of:
- Data Source: A dataset containing user listening history, track metadata, and demographic information.
- Apache Spark: Utilized for processing large datasets and performing collaborative filtering.
- FastAPI: Serves as the backend framework for handling API requests and integrating with the frontend.
- React: Provides a dynamic and interactive user interface for displaying recommendations and user matches.
- Python
- Apache Spark
- FastAPI
- React
- OpenAI API
Our Music-Based User Matchmaking System employs a collaborative filtering approach using matrix factorization. The methodology includes:
-
Data Preprocessing: Cleaning and transforming raw user listening data, including handling missing values and encoding categorical variables.
-
Feature Engineering: Creating temporal features (e.g., day of week, hour of day), user behavior features (e.g., listening count, mobile usage ratio), and track features (e.g., popularity, normalized length).
-
Model Architecture: Utilizing Apache Spark's MLlib to implement Alternating Least Squares (ALS) for matrix factorization.
-
Training and Evaluation: Splitting data into training and test sets, performing hyperparameter tuning via cross-validation, and evaluating using RMSE and MAE metrics.
-
Recommendation Generation: Predicting user-track ratings and generating top-N recommendations for each user.
Our system's performance was evaluated using standard regression metrics:
- Root Mean Squared Error (RMSE): 0.57
- Mean Absolute Error (MAE): 0.35
- Root Mean Squared Error (RMSE): 0.43
- Mean Absolute Error (MAE): 0.26
The significant improvement in both RMSE and MAE demonstrates the effectiveness of our hyperparameter tuning process and the robustness of our collaborative filtering approach for music recommendation.
- Python 3.x installed locally.
- Node.js and npm installed for the React frontend.
- An OpenAI API Key for generating recommendations.
git clone https://github.com/yourusername/MusicRecommendationSystem.git
cd MusicRecommendationSystemNavigate to the backend directory and create a virtual environment:
cd backend
python -m venv .venv
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`Install the required packages:
pip install -r requirements.txtCreate a .env file in the backend directory with your OpenAI API key:
OPENAI_API_KEY=your-openai-api-key
Navigate to the frontend directory:
cd ../frontend
npm installBuild the React app:
npm run buildStart the FastAPI backend:
uvicorn app.main:app --reloadStart the React frontend:
npm startOnce both the backend and frontend are running, open your browser and navigate to http://localhost:3000 to access the application.
- Personalized Recommendations: Users receive music recommendations based on their listening history.
- User Matchmaking: Discover users with similar musical tastes.
- Interactive UI: Explore recommended tracks and user matches through an intuitive interface.
This file contains all necessary configurations for connecting to external services such as OpenAI.
- OPENAI_API_KEY: Your OpenAI API key for accessing GPT models.
Ensure that your homepage field in package.json is set correctly if deploying on GitHub Pages.
- Connection Issues: Ensure that your API keys are correctly set in the environment variables.
- Frontend Build Errors: Check that all dependencies are installed correctly using
npm install.
Contributions are welcome! Please create an issue or submit a pull request if you have suggestions or improvements.

