Sign function
The sign function maps a numeric value to an indication of whether it is negative, zero, or positive, commonly represented as −1, 0, or 1.
Machine Learning Algorithms in Depth
A sign function returns the sign of a numeric input, commonly mapping positive and negative values to +1 and −1.
- How it is used
- Maps a perceptron’s linear score to binary predictions for classification.
- How deep it goes
- Defines the binary mapping and connects it to a hyperplane, without developing the function beyond linear classification.
- Examples
- Uses a perceptron classifier on the iris dataset and illustrates its two-dimensional decision boundary.
- What you can do after
- Evaluate a linear score as a binary classification prediction.
Read how Machine Learning Algorithms in Depth explains sign function →
Math and Architectures of Deep Learning
The positive, negative, or zero indicator of a numeric expression, used here to determine which side of a decision boundary a point lies on.
- How it is used
- Determines which side of a binary-classification decision boundary contains an input point.
- How deep it goes
- Defines negative, zero, and positive values geometrically, extending from lines to higher-dimensional surfaces.
- Examples
- Uses the line y + 2x + 1 = 0 and classifier planes to interpret point locations.
- What you can do after
- Evaluate a surface function’s sign to predict a binary class for an input vector.
Read how Math and Architectures of Deep Learning explains sign function →
Related concepts
- floating-point arithmeticpart of · Floating-point arithmetic is computation using finite-precision representations of real numbers, which can introduce rounding and range errors.
- decision boundaryuses · A decision boundary is the locus in input or feature space that separates regions assigned different classes or decision outcomes by a predictive model.
- sign bitimplemented by · A sign bit is a designated bit in a numeric representation that indicates whether the represented value is negative or nonnegative.
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.

