A step function turns a score into a discrete prediction: it returns 1 when the input is nonnegative and 0 when the input is negative. section 5.1
For a perceptron, calculate a weighted score first, then apply the step function: ŷ = step(ax₁ + bx₂ + c). The threshold divides the input space into two zones. section 5.1
Use the function in three straightforward steps:
- Represent labels numerically, such as happy = 1 and sad = 0. section 5.1
- Compute the model score from the features, weights, and bias. section 5.4
- Return 1 for a score of zero or greater; otherwise return 0. section 5.4
Classifying alien moods
Suppose a classifier scores an alien sentence using the counts of words such as aack and beep. A nonnegative score predicts happy, while a negative score predicts sad. The same rule works when the classifier separates points with a line or separates higher-dimensional data with a plane. section 5.1 section 5.4
Figure 5.8 The step function is useful in the study of perceptron models. The output of the step function is 0 when the input is negative and 1 otherwise.
View the graph showing the abrupt change from output 0 for negative inputs to output 1 otherwise. section 5.1

