E_Commerce.csv contains online retail transactions with features such as:
- OrderID: Unique identifier for each purchase
- CustomerID: Anonymized customer identifier
- OrderDate: Date and time of the order
- ProductCategory: Categorical label for the item purchased
- UnitPrice: Price per unit (in local currency)
- Quantity: Number of units sold
- Revenue: Total order value (UnitPrice × Quantity)
- Python 3.x
pandas,numpyfor data manipulationmatplotlib,seabornfor EDA and plottingscikit‑learnfor feature engineering, modeling, and evaluation
- Jupyter Notebook
- Power BI for interactive dashboards
-
Data Cleaning & Preprocessing
- Converted
OrderDatetodatetime, extracted day, month, and hour - Handled missing values via imputation or row removal
- Dropped duplicate transactions
- Converted
-
Exploratory Data Analysis
- Distribution of
Revenue,UnitPrice, andQuantity - Top‑selling product categories and monthly sales trends
- Correlation heatmap to identify relationships between features
- Distribution of
-
Feature Engineering
- Created
OrderHour,OrderMonth, andDayOfWeekfromOrderDate - One‑hot encoded
ProductCategory - Standardized numeric features (
UnitPrice,Quantity, etc.)
- Created
-
Model Building & Evaluation
- Trained four regressors:
- Linear Regression
- Decision Tree Regressor
- Random Forest Regressor
- K‑Nearest Neighbors Regressor
- Evaluated using R² and RMSE
- Trained four regressors:
-
Hyperparameter Tuning
- Performed
GridSearchCVon Random Forest - Selected best parameters for
n_estimatorsandmax_depth
- Performed
-
Conclusions & Recommendations
- Key Drivers of Revenue: Unit price, quantity sold, and order timing
- Best Model: Random Forest Regressor (R² ≈ 0.5, RMSE ≈ 25)
- Business Insights:
- Peak sales occur during weekends and holiday months
- Certain product categories consistently outperform others
- Next Steps: Incorporate customer demographics, marketing campaign data, and deploy model via Streamlit for real‑time revenue forecasting
- Clone the repository:
git clone https://github.com/yourusername/Capstone‑ECommerce‑Project.git cd Capstone‑ECommerce‑Project