An end-to-end machine learning web app that forecasts Walmart store weekly sales using a Random Forest Regressor, built with Streamlit.
⚠️ Note: The trained model file (best_model_.pkl) is not included in this repository due to its large size (~1.1 GB). Follow the Generate the Model section below to create it locally before running the app.
| Page | Description |
|---|---|
| 📊 Dashboard | KPI metrics, store/department filter, monthly trend & holiday impact |
| 📈 EDA | Distributions, time trends, heatmaps, outlier detection |
| 🔮 Prediction | Interactive 12-week sales forecast with Plotly charts |
| ℹ️ About | Project summary and model info |
Easy Predict/
│
├── app.py # Streamlit web application
├── EasyPredict_Part1 - Copy.ipynb # Data exploration & EDA
├── EasyPredict_Part2 - Copy.ipynb # Model training & evaluation → generates best_model_.pkl
├── walmart_sales_cleaned.csv # Cleaned Walmart sales dataset
├── requirements.txt # Python dependencies
├── .gitignore # Excludes best_model_.pkl
└── README.md
git clone https://github.com/harshpatel0000/easy-predict.git
cd easy-predictpip install -r requirements.txtThe app requires best_model_.pkl to run. Open and run all cells in:
EasyPredict_Part2 - Copy.ipynb
This notebook will:
- Load and preprocess
walmart_sales_cleaned.csv - Train 4 models: Linear Regression, Decision Tree, Random Forest, Gradient Boosting
- Automatically select the best model by R² score
- Save it as
best_model_.pklin the same folder
streamlit run app.pyOpen http://localhost:8501 in your browser.
Four regression models were trained and compared. The best model was selected automatically based on R² score.
| Model | Notes |
|---|---|
| Linear Regression | Baseline |
| Decision Tree | random_state=42 |
| ✅ Random Forest | n_estimators=100, max_depth=20, n_jobs=-1 — Best Model |
| Gradient Boosting | random_state=42 |
Features used: Store, Dept, IsHoliday, Year, Month, Week
Target: Weekly_Sales
Based on the Walmart Store Sales Forecasting dataset from Kaggle, cleaned and preprocessed.
Key columns:
| Column | Description |
|---|---|
Store / Store_Name |
Store identifier |
Dept / Dept_Name |
Department identifier |
Date |
Week of sales |
Weekly_Sales |
Target — weekly revenue |
IsHoliday |
Whether the week contains a public holiday |
streamlit
pandas
numpy
matplotlib
seaborn
plotly
scikit-learn==1.6.1Install with:
pip install -r requirements.txt
⚠️ Usescikit-learn==1.6.1— the model was trained with this version. A different version may cause anInconsistentVersionWarningor incorrect predictions.
| Layer | Tools |
|---|---|
| Web App | Streamlit |
| Visualization | Plotly, Matplotlib, Seaborn |
| Machine Learning | scikit-learn |
| Data Processing | Pandas, NumPy |
| Language | Python 3.11 |
This project is open source and available under the MIT License.