34. Classification in Python with Logistic Regression
34.5 Practice, Tip and Close
Why. Close when you can fit LogisticRegression, read predict_proba, and name one threshold trade-off.
How.
Chapter practice
- Invent 15 fictional Blinkit-style rows:
late_delivery0/1 from distance_km and rain_mm. - Split with stratify, fit LogisticRegression, print predictions.
- Print predict_proba for the test set.
- Try thresholds 0.3 and 0.7; note how flags change.
- Write one line: when would a lower threshold help the customer?
Thodkyaat sangaycha tar (quick recap)
- Classification → categories / yes-no
- LogisticRegression + predict / predict_proba
- Default threshold 0.5; change only with a reason
- Watch class balance and leakage
Samajla ka? Next: Chapter 35 — Decision Trees and Random Forests.