{"id":25909179,"url":"https://github.com/abhinav330/customer-behavior-analysis-linear-regression","last_synced_at":"2026-05-06T06:36:43.716Z","repository":{"id":254764842,"uuid":"847472876","full_name":"Abhinav330/Customer-behavior-Analysis-Linear-Regression","owner":"Abhinav330","description":"This repository explores customer behavior data for an NYC clothing company with both a mobile app and website. They want to understand which platform drives higher sales.","archived":false,"fork":false,"pushed_at":"2024-08-31T02:56:30.000Z","size":703,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T08:16:34.923Z","etag":null,"topics":["data-analysis","data-science","data-visualization","eda","exploratory-data-analysis","jupyter","jupyter-notebook","linear-regression","machine-learning","machine-learning-algorithms","machinelearning-python","numpy","pandas","python","regression-analysis"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Abhinav330.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-25T23:05:00.000Z","updated_at":"2024-08-31T02:56:34.000Z","dependencies_parsed_at":"2024-08-26T00:33:05.115Z","dependency_job_id":"e4c398fb-d6df-43a9-9607-14c0cfe1ac98","html_url":"https://github.com/Abhinav330/Customer-behavior-Analysis-Linear-Regression","commit_stats":null,"previous_names":["abhinav330/customer-behavior-analysis-linear-regression"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abhinav330/Customer-behavior-Analysis-Linear-Regression","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FCustomer-behavior-Analysis-Linear-Regression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FCustomer-behavior-Analysis-Linear-Regression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FCustomer-behavior-Analysis-Linear-Regression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FCustomer-behavior-Analysis-Linear-Regression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abhinav330","download_url":"https://codeload.github.com/Abhinav330/Customer-behavior-Analysis-Linear-Regression/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhinav330%2FCustomer-behavior-Analysis-Linear-Regression/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262357551,"owners_count":23298463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","data-science","data-visualization","eda","exploratory-data-analysis","jupyter","jupyter-notebook","linear-regression","machine-learning","machine-learning-algorithms","machinelearning-python","numpy","pandas","python","regression-analysis"],"created_at":"2025-03-03T08:16:36.362Z","updated_at":"2025-10-28T18:15:13.467Z","avatar_url":"https://github.com/Abhinav330.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://app.codacy.com/project/badge/Grade/32301d7281ec464d8023edf6cedd0add)](https://app.codacy.com/gh/Abhinav330/Customer-behavior-Analysis-Linear-Regression/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/Customer-behavior-Analysis-Linear-Regression/matplotlib?color=green)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/Customer-behavior-Analysis-Linear-Regression/numpy?color=silver)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/Customer-behavior-Analysis-Linear-Regression/pandas?color=red)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/Customer-behavior-Analysis-Linear-Regression/scikit-learn?color=red)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/Customer-behavior-Analysis-Linear-Regression/scipy?color=yellow)\n![GitHub Pipenv locked dependency version](https://img.shields.io/github/pipenv/locked/dependency-version/Abhinav330/Customer-behavior-Analysis-Linear-Regression/seaborn?color=beige)\n![GitHub Pipenv locked Python version](https://img.shields.io/github/pipenv/locked/python-version/Abhinav330/Customer-behavior-Analysis-Linear-Regression?color=dark%20green)\n![GitHub repo size](https://img.shields.io/github/repo-size/Abhinav330/Customer-behavior-Analysis-Linear-Regression)\n\n# Customer-behavior-Analysis-Linear-Regression\n\n# Code Summary\n\nThis repository explores customer behavior data for an NYC clothing company with both a mobile app and website. They want to understand which platform drives higher sales.\n\n## Data Exploration and Visualization\n\nThe code starts by importing necessary libraries, loading the 'Ecommerce Customers' dataset using pandas, and performing data exploration and visualization tasks:\n\n- Displays the first few rows of the dataset using `customers.head()`.\n- Provides summary statistics using `customers.describe()`.\n- Shows dataset information using `customers.info()`.\n- Creates various plots and visualizations:\n  - Joint plots to explore relationships between 'Time on Website/App' and 'Yearly Amount Spent'.\n  - A pair plot to visualize pairwise relationships between numerical features.\n  - A linear regression plot (`lmplot`) to visualize the relationship between 'Yearly Amount Spent' and 'Length of Membership'.\n\n## Data Preprocessing\n\nThe code preprocesses the data by selecting specific columns for feature variables ('X') and the target variable ('Y'). It then splits the dataset into training and testing sets using `train_test_split()`.\n\n## Linear Regression Modeling\n\nThe script proceeds to build a Linear Regression model to predict 'Yearly Amount Spent' based on the selected features ('Avg. Session Length', 'Time on App', 'Time on Website', 'Length of Membership'):\n\n- Imports `LinearRegression` from scikit-learn.\n- Initializes and fits a Linear Regression model to the training data.\n- Calculates the coefficients of the model using `lm.coef_`.\n- Makes predictions on the testing data using `lm.predict()`.\n- Visualizes the predictions against actual values using a scatter plot.\n\n## Model Evaluation\n\nThe code evaluates the Linear Regression model's performance by calculating and printing various regression metrics:\n\n- Mean Absolute Error (MAE).\n- Mean Squared Error (MSE).\n- Root Mean Squared Error (RMSE).\n- Additionally, it visualizes the distribution of residuals (the difference between actual and predicted values) using a histogram (`sns.distplot`).\n\n## Coefficients\n\nThe script creates a DataFrame (`coof`) to display the coefficients of the Linear Regression model along with their corresponding feature names.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinav330%2Fcustomer-behavior-analysis-linear-regression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhinav330%2Fcustomer-behavior-analysis-linear-regression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinav330%2Fcustomer-behavior-analysis-linear-regression/lists"}