This repository contains an analysis of Spotify data using linear regression techniques. The analysis is performed using Jupyter Notebooks (.ipynb
), making it easy to follow along with the steps and reproduce the results.
linear-regression-spotify/
├── README.md # Main documentation file
├── LICENSE # Licensing information
├── requirements.txt # Dependencies
├── data/ # Directory for datasets
│ └── spotify_track.csv # Dataset file
├── src/ # Source code directory
│ ├── simple_linear_regression.ipynb
│ ├── multiple_linear_regression_2vars.ipynb
│ └── multiple_linear_regression_more_vars.ipynb
data/spotify_track.csv
: Contains the Spotify data used in the analysis.src/simple_linear_regression.ipynb
: Demonstrates a single-variable linear regression model.src/multiple_linear_regression_2vars.ipynb
: Explores a linear regression model with two variables.src/multiple_linear_regression_more_vars.ipynb
: Applies a linear regression model with multiple variables.
To run the Jupyter Notebooks, you need the following dependencies:
- Python 3.8 or higher
- Jupyter Notebook or JupyterLab
- Libraries listed in
requirements.txt
Install the dependencies using pip:
pip install -r requirements.txt
-
Clone the repository:
git clone https://github.com/nurulashraf/linear-regression-spotify.git cd linear-regression-spotify
-
Launch Jupyter Notebook or JupyterLab:
jupyter notebook
or
jupyter lab
-
Open the desired
.ipynb
file in your browser. -
Run the cells sequentially to reproduce the results.
This notebook examines the relationship between one independent variable and a dependent variable using a simple linear regression model.
This notebook expands the analysis by including two independent variables in the model.
This notebook builds a comprehensive model using multiple independent variables to predict the dependent variable.
The dataset is stored in the data/spotify_track.csv
file. It contains the necessary features for performing the analysis. If you use a custom dataset, ensure it follows the same format.
The Jupyter Notebooks include various visualisations to aid understanding:
- Scatter plots
- Regression lines
- Residual plots
- Metrics comparison charts
Contributions are welcome! If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request.
This project is licensed under the terms of the MIT License.
Created by Nurul Ashraf.
If you find this project helpful, please ⭐ the repository!