IIT Madras BS in Data Science – Machine Learning Project
This project was completed as part of the Data Science & Machine Learning coursework at IIT Madras, and submitted on Kaggle. The objective is to predict a customer’s purchase value based on their digital behavior across multiple sessions.
Modern e-commerce platforms collect large volumes of user interaction data—session activity, devices, traffic sources, clicks, and more. The goal of this competition is to model customer intent and predict the final purchase amount they might spend.
This project builds a complete ML pipeline including:
Exploratory Data Analysis (EDA)
Data cleaning & preprocessing
Feature engineering (categorical encodings, numerical transformations)
Handling multi-session data
Zero-inflated target modeling
Two-stage prediction architecture
Model evaluation and submission generation
For each customer ID in the test set, predict: purchaseValue (continuous target) The competition uses R² score as the official evaluation metric.
├── data/
│ ├── external/ # Documentation, data dictionary, kaggle link
│ └── raw/ # Raw data (Training & Test Csv's)
│
├── notebooks/
│ └── main_notebook.ipynb # Full Kaggle notebook used in the project
│
├── src/
│ ├── utils/ # Helper scripts
│ └── modeling/ # Model code
│
├── reports/
│ └── figures/ # EDA charts, model plots
│
├── .gitignore
├── README.md
└── LICENSENote: Dataset is not included in the repository due to Kaggle terms of use.
Checked missing values
Plotted distributions
Correlation matrix
Session-level analysis
User-level aggregation
Handled missing values
Min-max scaling for continuous features
Frequency-based encoding for categorical features
Rank encoding & target encoding for high-cardinality features
PCA for dimensionality reduction
This project was a regression model, the goal of this was to try out 3 models and create the submission on the best model.
Models tested:
- XGBOOST Regeressor
- LightGBM Regressor
- RandomForest Regressor
This project uses a regression-based approach to predict the continuous target variable purchaseValue.
Initially, multiple methods were explored to address the zero-inflation problem (Since ≈80% of users had purchaseValue = 0):
| Method Tried | Description | Result |
|---|---|---|
| Log transform on target | Applied log(1 + purchaseValue) to normalize skew and reduce zero-inflation | Best performance |
The log-transformed regression method delivered the highest R² score on the validation set.
The target was transformed as:
y_log = log(1 + purchaseValue)
After prediction, the exponential inverse transform was applied:
purchaseValue = exp(y_log_pred) - 1
| Model | Notes |
|---|---|
| XGBoost Regressor | Performed well but prone to overfitting |
| LightGBM Regressor | Competitive score, fast training |
| RandomForest Regressor (Final Choice) | Best performance with log-transformed target |
The RandomForest Regressor trained on the log-transformed target generated the highest public test score and was used to produce the final Kaggle submission.
This project helped me strengthen skills in:
End-to-end ML pipeline design
Working with large behavioral datasets
Handling zero-inflated regression
Best practices for Kaggle competitions
Feature engineering & advanced encodings
Model tuning & evaluation
Python
Pandas, NumPy
Scikit-learn
XGBOOST / LightGBM / RandomForest Regressor
Matplotlib / Seaborn
Kaggle Notebooks
- 🔗 Kaggle Project Page: Notebook Link
- 🔗 Competition Link: Kaggle Competition
If you’d like to discuss this project or opportunities:
RAHUL V S
📧 Email: rahulvenuklr@gmail.com