Ravindra BagaleCourses & study guides मराठी Track your progress

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

  1. Invent 15 fictional Blinkit-style rows: late_delivery 0/1 from distance_km and rain_mm.
  2. Split with stratify, fit LogisticRegression, print predictions.
  3. Print predict_proba for the test set.
  4. Try thresholds 0.3 and 0.7; note how flags change.
  5. 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.