04.01 Lesson 1 of 16
54 minML Problem Framing & Learning Types
Translate a vague prediction idea into a concrete machine-learning task with a defined target, available features and evaluation objective.
By the end of this lesson
You will be able to
- Distinguish regression, classification and clustering.
- Separate the business question from the model choice.
- State when each feature becomes available and what an acceptable error means.
Start with the prediction contract
A machine-learning task begins with an observation unit and an outcome. For Bank Marketing, one row represents a client-contact example and the target y records whether the client subscribed to a term deposit. The feature matrix X contains information available before the prediction; the target vector y contains the outcome you want the model to learn. Write the prediction moment explicitly. A field recorded after that moment is not a valid feature, even if it improves a score.
# X: information available before the call
# y: whether the client subscribed
X = df.drop(columns=["y", "duration"])
y = df["y"] Choose the learning setup from the target
In supervised learning, examples come with labels. Regression predicts a numeric quantity such as demand; classification predicts a category or class probability. In unsupervised learning, no target is supplied: clustering groups observations, while dimensionality reduction compresses their representation. The algorithm is not the objective. A good problem statement names the target, prediction time, decision, error costs and a baseline that a model must improve.
Apply what you learned
ExerciseWrite a prediction brief
Choose a prediction question and define its data contract before choosing an algorithm.
- State the observation unit and target variable.
- Classify the task as regression, classification or unsupervised learning.
- List at least five candidate features and state when each becomes available.
- Write one realistic baseline that does not require a fitted model.
- Choose one primary metric and explain what a false positive or false negative would cost.
The brief names the target, observation unit, prediction time, permitted features, baseline and evaluation metric. It does not choose an algorithm before defining the task.
Free references
Study resources
- 01 Getting Started with scikit-learn Article
Read the estimator basics and short example that fits, predicts and evaluates a model. Treat it as a reference, not a full course.
Check your understanding
Self-test
-
Question 1
What makes a task supervised?
The training examples include a target label or value that the model learns to predict. -
Question 2
Why is prediction time part of the feature definition?
A feature is valid only when it would be available at the moment the prediction is made. Later information creates leakage.
Completion check
Move on when
You can write a prediction contract that identifies the task, target, observation unit, prediction time, valid features and evaluation objective.