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
Always end your project story with one label sentence, such as: “We predict ___.” Fill the blank with the exact thing the model will predict. If your story has no label, it is not complete yet.
Ravindra Bagale's Tip – मराठी
तुमची project story नेहमी एका label वाक्याने संपवा, जसं: “आपण ___ predict करतो.” Model नक्की काय predict करणार आहे ते त्या रिकाम्या जागेत लिहा. Story मध्ये label नसेल, तर ती अजून पूर्ण झालेली नाही.
Ravindra Bagale's Tip – हिंदी
अपनी project story हमेशा एक label वाक्य से खत्म करो, जैसे: “हम ___ predict करते हैं.” Model ठीक-ठीक क्या predict करेगा, वह खाली जगह में लिखो. अगर story में label नहीं है, तो वह अभी पूरी नहीं हुई है.