Lesson 2 · Machine Learning
Supervised Learning
7 min
You'll be able to
- Explain features and labels
- Distinguish classification from regression
- Build intuition for how a model is evaluated
In supervised learning, each training example is an input paired with a target — the 'correct answer'. The model learns a function that maps inputs to targets as accurately as possible.
Two task families
- Classification — predict a category (spam / not spam, cat / dog).
- Regression — predict a continuous number (house price, temperature).
# features: [size_sqft, bedrooms, location_score]
# label: price
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(X_train, y_train) # learn the mapping
predicted = model.predict(X_test) # predict on unseen dataChallenge
Design a feature
For a house-price model, propose three features and state whether each is numeric or categorical.
Knowledge Check
Supervised learning
Predicting tomorrow's temperature is an example of:
In supervised learning, 'features' are the inputs the model uses to make a prediction.
Answer all questions to submit.