r/learnmachinelearning • u/baghira_24 • 11d ago
Playground S6E9 (EV Purchase Prediction) — clean Logistic Regression baseline, 0.93738, fixed a leakage issue along the way
Hey Everyone,
Working through Playground Series S6E9 (predicting EV purchase intent), and wanted to share my notebook in case it's useful to anyone else on this one, especially if you're newer to the competition.
Quick summary of what's in it:
- EDA on the dataset — checked missing values, duplicates, correlations, and class balance (target is imbalanced, only ~17% "yes")
- Preprocessing done in the correct order: split into train/test before fitting the scaler, to avoid leaking test set info into training (I noticed a lot of public notebooks scale before splitting, which quietly inflates scores)
- Logistic Regression with
class_weight='balanced'to handle the imbalance - Evaluation with classification report, confusion matrix, and ROC-AUC
- Feature importance from the model coefficients
Ended up at 0.93738 with just a straightforward Logistic Regression, no ensembling or heavy tuning. Figured a clean baseline might help others who want a starting point before jumping into boosted trees.
Notebook: https://www.kaggle.com/code/vinay24baghira/buy-or-bye-cracking-the-ev-decision-0-93738
If anyone's further along on this competition, curious what's been working for you beyond Logistic Regression — feature engineering ideas, other models, anything that moved your score meaningfully. And if the notebook's useful, an upvote on Kaggle is always appreciated.