A step function converts a weighted sum into a binary decision. If the sum exceeds a chosen threshold, it returns 1; otherwise, it returns 0. In a perceptron, this thresholding step determines whether the neuron fires, adding nonlinear behavior beyond linear regression. section 5.1.5
Thresholding a neuron output
For the phrase “green egg egg ham ham ham spam spam spam spam,” a weighted feature sum might be -0.76. With threshold = 0.0, Python evaluates int(y > threshold), producing 0. Changing the weights or threshold can change the decision. Use a logistic activation instead when the output should represent a continuous likelihood. section 5.1.5
>>> threshold = 0.0 >>> y = int(y > threshold)
Inspect the minimal Python implementation that applies a zero threshold to a neuron’s weighted output. section 5.1.5

