30. The Machine Learning Workflow Step by Step
30.2 An India Story Walkthrough
Why. Abstract steps feel empty. One Maharashtra story makes them sticky.
What. Fictional story: Amazon Now-style dark store in Kolhapur wants to guess late delivery risk before the rider leaves. Label = was_late (1 if delivery > 20 minutes, else 0). Numbers are fictional.
How.
Walk the five steps on the story
- Data. Rani exports 2,000 past orders: city zone, item count, rain flag, time of day, was_late.
- Features. She keeps
items,rain_mm,hour_ist,distance_km. She drops rider name (unfair / unstable). - Train. She learns a model on 80% of past rows (Chapter 31 split).
- Evaluate. On the other 20%, she checks how often late guesses were right (later chapters teach metrics).
- Predict. For a new order at 7:40 PM with rain, the model outputs a late-risk score. A human still decides whether to add a second picker.
import pandas as pd
# Fictional mini snapshot of the story table
story = pd.DataFrame({
"order_id": ["AMN-100", "AMN-101", "AMN-102"],
"items": [2, 9, 4],
"rain_mm": [0, 18, 2],
"hour_ist": [11, 19, 20],
"distance_km": [1.5, 6.2, 3.1],
"was_late": [0, 1, 0],
})
print(story)
print("Workflow words: data ready → choose features → (later) train/evaluate/predict")
What you should see. A table that already looks like supervised ML input. We still do not fit a model in this chapter.
Fictional data
Order counts, rain and late flags are invented for teaching. Not real Amazon / Blinkit figures.
Ravindra Bagale's Tip
Story nehmi label sentence ni sampta: “Aapan ___ predict karato.” Label nahi = story incomplete. Lakshat theva.