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 →
Grokking Machine Learning, Second Edition
A threshold function that maps an input to one of discrete output levels according to whether the input crosses a boundary.
- How it is used
- Converts perceptron scores into binary predictions for discrete classification.
- How deep it goes
- Defines the threshold, gives a graph and Python implementation, and stops short of using it for practical neural-network training.
- Examples
- Uses happy-or-sad labels, thresholded scores, a Python step function, and connected perceptrons in a neural-network diagram.
- What you can do after
- Apply it via Python to turn perceptron scores into discrete predictions.
Read how Grokking Machine Learning, Second Edition explains step function →
Also covered in
- Math and Architectures of Deep Learning
- Statistics Every Programmer Needs
- Grokking AI Algorithms, Second Edition
What to know first
- objective functionAn objective function is a mathematical function that assigns values to candidate solutions or parameter settings, which an optimization procedure seeks to minimize or maximize.
- batch gradient descentBatch gradient descent is an optimization method that computes each parameter update using the entire training dataset.
- inner productAn inner product is a scalar-valued operation on two vectors that generalizes the dot product, which for real coordinate vectors is the sum of products of corresponding components.
- perceptronA perceptron is a single-layer computational model and linear classifier that combines weighted inputs with a bias and applies a threshold or activation rule.
Related concepts
- activation functionkind of · An activation function transforms a neural-network unit’s input into its output, often introducing nonlinearity.
- 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.
- cumulative distribution functionused by · A cumulative distribution function maps each value to the probability that a random variable is less than or equal to that value.
- sigmoidalternative to · The logistic sigmoid is a smooth, S-shaped function that maps real-valued inputs to values between zero and one.
- generationused by · Generation is the production of an output by a computational model from supplied input or context, often using patterns learned from data.
- discrete variableproduces · A discrete variable is a variable whose possible values belong to a finite or countable set of distinct alternatives rather than a continuous range.
Questions about step function
What is 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.
Which Manning books explain step function?
Grokking Machine Learning, Natural Language Processing in Action, Second Edition and Grokking Machine Learning, Second Edition.
What should I know before learning step function?
Manning books that teach step function usually introduce objective function, batch gradient descent, inner product and perceptron first.
What is the difference between step function and sigmoid?
A step function is a piecewise-constant function that changes abruptly between discrete output values when its input crosses one or more specified thresholds. The logistic sigmoid is a smooth, S-shaped function that maps real-valued inputs to values between zero and one.
What is step function a kind of?
Step function is a kind of activation function. An activation function transforms a neural-network unit’s input into its output, often introducing nonlinearity.
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.


