Skip to content

nurulashraf/linear-regression-spotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linear Regression Analysis on Spotify Dataset

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.


Repository Structure

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      

File Descriptions

  • 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.

Requirements

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

Running the Notebooks

  1. Clone the repository:

    git clone https://github.com/nurulashraf/linear-regression-spotify.git
    cd linear-regression-spotify
  2. Launch Jupyter Notebook or JupyterLab:

    jupyter notebook

    or

    jupyter lab
  3. Open the desired .ipynb file in your browser.

  4. Run the cells sequentially to reproduce the results.


Analysis Overview

Simple Linear Regression

This notebook examines the relationship between one independent variable and a dependent variable using a simple linear regression model.

Multiple Linear Regression (2 Variables)

This notebook expands the analysis by including two independent variables in the model.

Multiple Linear Regression (More Variables)

This notebook builds a comprehensive model using multiple independent variables to predict the dependent variable.


Dataset

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.


Visualisations

The Jupyter Notebooks include various visualisations to aid understanding:

  • Scatter plots
  • Regression lines
  • Residual plots
  • Metrics comparison charts

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request.


License

This project is licensed under the terms of the MIT License.


Author

Created by Nurul Ashraf.

If you find this project helpful, please ⭐ the repository!