Time Series Forecasting of Walmart Sales Data using Deep Learning and Machine Learning
Last updated Jun 11, 2026
38
Stars
16
Forks
0
Issues
0
Stars/day
Attention Score
24
Topics
Language breakdown
No language data available.
▸ Files
click to expand
README
# Walmart Sales Time Series Forecasting Using Machine and Deep Learning Time Series Forecasting of Walmart Sales Data using Deep Learning and Machine Learning
Blog of this Project
Walmart Sales Time Series Forecasting using Deep Learning on Medium.com
Datasets
Walmart Recruiting - Store Sales Forecasting downloaded from https://www.kaggle.com/c/walmart-recruiting-store-sales-forecasting - train.csv - CSV Data file containing following attributes - Store - Dept - Date - Weekly_Sales - IsHoliday115064 Data rows - stores.csv - CSV Data File containing following attributes - Store - Type - Size 45 Data rows - features.csv - CSV Data file containing following attributes - Store - Date - Temperature - Fuel_Price - MarkDown1 - MarkDown2 - MarkDown3 - MarkDown4 - MarkDown5 - CPI - Unemployment - IsHoliday 8190 Data rows
Machine Learning Models
- Linear Regression Model
- Random Forest Regression Model
- K Neighbors Regression Model
- XGBoost Regression Model
- Custom Deep Learning Neural Network
Data Preprocessing
- ### Handling Missing Values
- ### Merging Datasets
- ### Splitting Date Column
- ### Aggregate Weekly Sales
- ### Outlier Detection and Other abnormalities
- ### One-hot-encoding
- ### Data Normalization
- ### Recursive Feature Elimination
Splitting Dataset
- Dataset was splitted into 80% for training and 20% for testing
- Target feature - Weekly_Sales
Linear Regression Model
- Linear Regressor Accuracy - 92.28
- Mean Absolute Error - 0.030057
- Mean Squared Error - 0.0034851
- Root Mean Squared Error - 0.059
- R2 - 0.9228
LinearRegression(copyX=True, fitintercept=True, n_jobs=None, normalize=False)
Random Forest Regression Model
- Random Forest Regressor Accuracy - 97.889
- Mean Absolute Error - 0.015522
- Mean Squared Error - 0.000953
- Root Mean Squared Error - 0.03087
- R2 - 0.9788
- n_estimators - 100
RandomForestRegressor(bootstrap=True, ccpalpha=0.0, criterion='mse', maxdepth=None, maxfeatures='auto', maxleafnodes=None, maxsamples=None, minimpuritydecrease=0.0, minimpuritysplit=None, minsamplesleaf=1, minsamplessplit=2, minweightfractionleaf=0.0, nestimators=100, njobs=None, oobscore=False, randomstate=None, verbose=0, warmstart=False)
K Neighbors Regression Model
- KNeigbhbors Regressor Accuracy - 91.9726
- Mean Absolute Error - 0.0331221
- Mean Squared Error - 0.0036242
- Root Mean Squared Error - 0.060202
- R2 - 0.919921
- Neighbors - 1
KNeighborsRegressor(algorithm='auto', leafsize=30, metric='minkowski', metricparams=None, njobs=None, nneighbors=1, p=2, weights='uniform')
XGBoost Regression Model
- XGBoost Regressor Accuracy - 94.21152
- Mean Absolute Error - 0.0267718
- Mean Squared Error - 0.0026134
- Root Mean Squared Error - 0.051121
- R2 - 0.942115235
- Learning Rate - 0.1
- n_estimators - 100
XGBRegressor(basescore=0.5, booster='gbtree', colsamplebylevel=1, colsamplebynode=1, colsamplebytree=1, gamma=0, importancetype='gain', learningrate=0.1, maxdeltastep=0, maxdepth=3, minchildweight=1, missing=None, nestimators=100, njobs=1, nthread=None, objective='reg:linear', randomstate=0, regalpha=0, reglambda=1, scaleposweight=1, seed=None, silent=None, subsample=1, verbosity=1)
Custom Deep Learning Neural Network Model
- Deep Neural Network accuracy - 90.50328
- Mean Absolute Error - 0.033255
- Mean Squared Error - 0.003867
- Root Mean Squared Error - 0.06218
- R2 - 0.9144106
- Kernel Initializer - normal
- Optimizer - adam
- Input layer with 23 dimensions and 64 output dimensions and activation function as relu
- 1 hidden layer with 32 nodes
- Output layer with 1 node
- Batch Size - 5000
- Epochs -100
Comparing Models
- Linear Regressor Accuracy - 92.280797
- Random Forest Regressor Accuracy - 97.889071
- K Neighbors Regressor Accuracy - 91.972603
- XGBoost Accuracy - 94.211523
- DNN Accuracy - 90.503287
Citations
- Walmart Recruiting - Store Sales Forecasting
Written with StackEdit.
🔗 More in this category