Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nehul1149/sales-prediction-using-linear-regression
https://github.com/nehul1149/sales-prediction-using-linear-regression
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/nehul1149/sales-prediction-using-linear-regression
- Owner: Nehul1149
- Created: 2024-10-24T17:28:02.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T17:31:59.000Z (3 months ago)
- Last Synced: 2024-10-26T01:29:11.036Z (3 months ago)
- Language: Jupyter Notebook
- Size: 3.96 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Explanation of Key Sections:
## Data Preparation and Feature Engineering:1- Load the dataset.
Create a sales difference column and generate supervised data.
Split the data into training and testing sets.2- Scaling:
Use Min-Max scaling to scale the features between -1 and 1.3- Training and Predictions:
Train a Linear Regression model.
Make predictions and inverse transform the results to the original scale.4- Evaluation:
Calculate MSE, MAE, and R2 score to evaluate the model’s performance.5- Visualization:
Plot the actual sales versus predicted sales for visual comparison.# Sales Prediction with Linear Regression
This project demonstrates how to use linear regression to predict monthly sales based on historical sales data. The project includes data preprocessing, feature engineering, model training, evaluation, and visualization.
## Introduction
The goal of this project is to predict future sales using a linear regression model. We use historical sales data, preprocess it, create a supervised learning dataset, and train a linear regression model to make predictions. The project also includes evaluation metrics and visualizations to compare the predicted sales against the actual sales.
## Prerequisites
- Python 3.x
- Pandas
- NumPy
- Scikit-learn
- Matplotlib# The script will perform the following steps:
* Load and preprocess the data
* Create a supervised learning problem
* Split the data into training and testing sets
* Train a linear regression model
* Evaluate the model using MSE, MAE, and R2 score
* Plot the actual vs. predicted sales# Results