Skip to content

sparsh0106/Regression-Analysis-of-Ecommerce-Customers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REGRESSION ANALYSIS with LINEAR REGRESSION and XGBOOST

This repository contains two Jupyter Notebook implementations showcasing regression analysis using:

  1. Linear Regression

  2. XGBoost Regression


Overview

The notebooks analyze the Ecommerce Customers dataset, performing predictive modeling to determine customer behavior and associated trends.

Files

  • linear_reg.ipynb: Demonstrates regression using the LinearRegression model from Scikit-Learn.

  • xgboost_reg.ipynb: Implements regression using the XGBoost library’s XGBRegressor.


Prerequisites

Before running the notebooks, ensure you have the following installed:

  • Python 3.8+
  • Jupyter Notebook
  • Required Python ilbraries:
    • pandas
    • numpy
    • seaborn
    • sci-kit
    • xgboost

You can install the necessary libraries using:

pip install pandas numpy seaborn scikit-learn xgboost

Data

Both notebooks use the Ecommerce Customers dataset. Ensure the dataset is available in the working directory before running the notebooks.

Dataset name: Ecommerce Customers

Columns include:

  • Email
  • Address
  • Avatar
  • Avg. Session Length
  • Time on App
  • Time on Website
  • Length of Membership
  • Yearly Amount Spent

Usage

1. Linear Regression

The linear_reg.ipynb notebook covers:

  • Data preprocessing and exploration.

  • Building a regression model using LinearRegression from Scikit-Learn.

  • Evaluating model performance with metrics like Mean Squared Error and R-squared.

2. XGBoost Regression

The xgboost_reg.ipynb notebook includes:

  • Data preprocessing and exploration.

  • Building a regression model using XGBRegressor from the XGBoost library.

  • Fine-tuning the model with hyperparameter optimization.

  • Evaluating performance metrics for comparison with the linear regression model.


Running the Notebooks

  1. Clone this repository:
git clone <repository_url>
cd <repository_folder>
  1. Start Jupyter Notebook:
jupyter notebook
  1. Open and run either linear_reg.ipynb or xgboost_reg.ipynb.

Results

The outputs include:

  • Insights into dataset relationships and trends using visualizations.

  • Model performance metrics and predictions.


Contributions

Feel free to fork the repository, submit issues, or create pull requests to enhance the notebooks.


License

This project is licensed under the MIT License.

About

Regression Analysis of Ecommerce Customers Dataset using Linear Regression and XGBRegressor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published