What machine learning is: data, features, labels, training and prediction
ML Foundations · 10 questions
Short notes
Key idea
Machine learning finds a pattern in past examples and uses it to predict new ones. You give it features (inputs) and, for supervised learning, labels (the right answers). Training adjusts the model until its predictions match the labels as well as possible.
Syntax
- Supervised: labelled data. Classification predicts a category (spam / not spam); regression predicts a number (delivery time).
- Unsupervised: no labels, e.g. clustering customers into groups.
- Training: fit the model on examples. Prediction (inference): apply it to new data.
- Features: X, a table of inputs. Label: y, the target column.
Example
Predicting whether a customer will churn: features are months active, orders last 90 days, complaints and plan type; the label is "left within 30 days" (yes/no) from last year's data. The trained model scores current customers so the team can call the riskiest first.
Traps
- ML needs examples of the outcome; no labelled history, no supervised model.
- A rule may be enough: if "no order in 60 days" predicts churn well, you don't need ML.
- Garbage in, garbage out: wrong labels teach wrong patterns.
- Predictions are probabilities, not certainties.
Want the full lesson with step-by-step examples, a project and a certificate? ML Foundations course, ₹180 →
- Question 1easy
What is the key difference between traditional programming and machine learning?
- Question 2easy
You predict whether a website visit ends in a purchase. Which is the label?
- Question 3medium
What is the majority-class baseline accuracy?
import pandas as pd labels = pd.Series([0, 0, 0, 1, 0, 1, 0, 0, 1, 0]) print(max(labels.mean(), 1 - labels.mean()))
- Question 4hard
Try thresholds 0 to 5 for the rule "predict 1 when
x >= t". Store the threshold with the highest accuracy againsty(the smallest one if tied) inresult.Store your answer in
result. - Question 5medium
Predicting how many rupees a customer will spend next month is which kind of problem?
What machine learning is: data, features, labels, training and prediction
What machine learning is: data, features, labels, training and prediction
What machine learning is: data, features, labels, training and prediction
What machine learning is: data, features, labels, training and prediction
What machine learning is: data, features, labels, training and prediction
5 more questions on this topic, with hints, and tests
Sign up free for 21 days of every question and test.