Step function
A step function is a piecewise-constant function that changes abruptly between discrete output values when its input crosses one or more specified thresholds.
Grokking Machine Learning
A threshold function that maps an input to one of discrete constant values according to whether the input crosses a specified threshold.
- How it is used
- Converts perceptron scores into binary class predictions.
- How deep it goes
- Defines the threshold rule, writes its formula, graphs its output, and implements it in Python before using it in a perceptron.
- Examples
- Uses alien moods, word-count features, separating lines, and Python prediction code as concrete examples.
- What you can do after
- Apply it via a Python prediction function to convert a perceptron score into a binary label.
Natural Language Processing in Action, Second Edition
A step function maps a value to one of discrete outputs according to whether it crosses a specified threshold.
- How it is used
- Converts a perceptron’s weighted input sum into a binary firing decision.
- How deep it goes
- Defines thresholding and demonstrates its Python expression, stopping short of training or backward propagation.
- Examples
- Uses a bag-of-words phrase, random weights, a -0.76 sum, and a zero-threshold Python expression.
- What you can do after
- Apply it via Python to turn a neuron’s numerical output into a binary prediction.
Read how Natural Language Processing in Action, Second Edition explains step function →
Related concepts
- activation functionkind of · An activation function maps a neural-network unit’s or layer’s input to an output, often introducing nonlinearity into the network’s computation.
- perceptronused by · A perceptron is a single-layer computational model and linear classifier that combines weighted inputs with a bias and applies a threshold or activation rule.
- generationused by · Generation is the computational production of outputs from supplied inputs or context, often by applying a model to produce predictions or new content.
- cumulative distribution functionused by · A cumulative distribution function gives the probability that a random variable is less than or equal to each specified value.
- sigmoidalternative to · A sigmoid is a smooth, bounded, S-shaped function that maps real-valued inputs between two limiting values, commonly zero and one.
- language modelused by · A language model is a computational model that represents patterns in linguistic tokens to estimate sequence probabilities and predict or generate language from context.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

