Training Sequence
A prediction rule maps a domain point to a label.
From Input to Prediction
A machine-learning learner ultimately needs to produce a way to make predictions. That way is a prediction rule: a function that takes a domain point and maps it to a label. Once the rule exists, it can be applied to new domain points, such as future papayas, to predict their labels.
One Point Through h
What do you think happens?
Suppose a new domain point is passed into a prediction rule h. What kind of result should come out?
Reveal answer
Answer: A label in Y
A prediction rule takes a domain point as input and maps it to a label. The result is therefore a label in Y, which is used as the prediction for that point.
To follow one prediction from start to finish, begin with a new domain point. Apply the prediction rule h to that point. The result is a label in Y. The rule has transformed the input point into the label that will be used as its prediction.
Applying a Rule to a New Papaya
A prediction rule h is used with a new papaya as its domain point. Describe the prediction process without specifying the internal details of h.
Start with the point: The new papaya is the domain point supplied to the prediction rule.
Apply h: The prediction rule receives that domain point as its input.
Read the result: The rule returns a label in Y. That label is the prediction for the new papaya.
A domain point is passed into h, and a label in Y comes out as its predicted label.
Reading h : X → Y
The notation h : X → Y says that h is a prediction rule whose inputs are domain points from X and whose outputs are labels in Y. The arrow expresses the direction from domain points to labels.
Read the notation from left to right as follows: h is the rule, X is the domain of points that the rule can receive, and Y is the set of labels that the rule produces. The arrow is not describing a learning step. It describes the direction of prediction: a point from X is mapped to a label in Y.
From Sequence to Hypothesis
A learning algorithm produces a prediction rule. The source uses A for the learning algorithm and S for the training sequence. The notation A(S) means the hypothesis returned by algorithm A after it receives training sequence S.
Prediction rule and hypothesis are closely related, but they emphasize different things. Prediction rule names the kind of object needed to make predictions: a function from domain points to labels. Hypothesis names the particular prediction rule returned by a learning algorithm after processing a training sequence. Thus, A(S) is not the training sequence itself and not the algorithm itself; it is the rule produced from them.
| Term | What it identifies | Role |
|---|---|---|
| Prediction rule | A function from domain points to labels | Makes predictions |
| Learning algorithm A | The algorithm that receives a training sequence | Produces a prediction rule |
| Training sequence S | The sequence received by the learning algorithm | Serves as input to A |
| Hypothesis A(S) | The prediction rule returned by A after receiving S | Makes predictions for domain points |
The terms describe different parts of the learning-and-prediction setup.
Common Mistakes
Treating a prediction rule as a domain point.
The domain point is the input, while h is the function that maps the point to a label.
Fix:
Keep the roles separate: supply a domain point to h and interpret the resulting element of Y as the prediction.Reading h : X → Y as a statement that X changes into Y by itself.
The notation identifies h as the rule that maps points from X to labels in Y.
Fix:
Include the rule in the process: a domain point from X is passed through h, producing a label in Y.Confusing the hypothesis A(S) with the training sequence S.
S is the training sequence received by A, whereas A(S) is the hypothesis returned after receiving S.
Fix:
Remember the direction: A receives S and returns A(S), a prediction rule.Assuming that a hypothesis is separate from a prediction rule.
A hypothesis is the prediction rule returned by a learning algorithm.
Fix:
Understand hypothesis as the particular prediction rule produced from a training sequence.
Practice
For the notation h : X → Y, identify the rule, the input side, the output side, and the direction of prediction. Then explain in one sentence what happens when a new domain point is passed to h.
Hints
- The symbol h names the prediction rule.
- X contains the domain points and Y contains the labels.
- The arrow points from the domain side toward the label side.
Complete the relationship in words: algorithm A receives training sequence S and returns ________. Explain why the blank is a prediction rule rather than the training sequence.
Hints
- Use the notation introduced for the result of applying A to S.
- The result is the hypothesis returned by the learning algorithm.
Key Takeaways
- A prediction rule is a function that maps a domain point to a label. In h : X → Y, h is the rule, X is the domain of points, Y is the set of labels, and the arrow shows the prediction direction. Applying h changes the focus from an input point to its predicted label. A learning algorithm A receives a training sequence S and returns the hypothesis A(S), which is a particular prediction rule.
Key Takeaways
- A prediction rule maps domain points to labels.
- The notation h : X → Y expresses that h maps points from X to labels in Y.
- Applying a prediction rule to a new domain point produces a label used as its prediction.
- A learning algorithm A receives a training sequence S and returns the hypothesis A(S).
- The hypothesis is the particular prediction rule produced by the learning algorithm.