A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Decision Boundaries in Classification

Graduate Depth 91 in the knowledge graph ☐ I know this ☆ Set as goal
2topics build on this
626prerequisites beneath it
See this on the map →
Linear Regression in Machine LearningSupervised Learning Fundamentals→→Logistic Regression for Classification
classification geometry model-interpretation

Core Idea

A decision boundary separates the feature space into regions for different classes; decision boundaries may be linear (logistic regression, SVMs with linear kernels) or nonlinear (neural networks, decision trees, SVMs with nonlinear kernels). Understanding decision boundaries reveals model assumptions and limitations, such as whether a model can represent disjoint classes or capture nonlinear patterns.

How It's Best Learned

Visualize decision boundaries in 2D for different classifiers (logistic regression, k-NN, decision trees, SVMs) to understand how they partition the space differently.

Explainer

From your study of supervised learning and linear regression, you know that a model learns a mapping from input features to outputs. In classification, the output is a discrete class label rather than a continuous value, and the decision boundary is the surface in feature space where the model switches from predicting one class to predicting another. Understanding what this boundary looks like — its shape, its flexibility, and its relationship to the data — is one of the most powerful ways to understand what a classifier is actually doing.

Start with the simplest case: a linear classifier in two dimensions. Imagine plotting data points on a plane with two features as axes, colored by class. A linear model like logistic regression finds a single straight line (or, in higher dimensions, a hyperplane) that best separates the classes. On one side of the line, the model predicts class A; on the other, class B. The line's position and angle are determined by the learned weights — the same coefficients you encountered in linear regression, but now passed through a sigmoid function to produce class probabilities. The boundary itself is the set of points where the predicted probability is exactly 50%. This simplicity is both the strength and the limitation: linear boundaries are fast to compute and resistant to overfitting, but they cannot capture situations where the classes are interleaved or separated by a curved surface.

Nonlinear decision boundaries arise from models with more expressive capacity. A decision tree partitions the space with axis-aligned splits, producing a boundary that looks like a staircase — a series of horizontal and vertical cuts. A k-nearest-neighbors classifier creates an irregular, locally adaptive boundary that follows the contours of the data, because the class prediction at any point depends only on its nearest labeled neighbors. Support vector machines with nonlinear kernels (like the radial basis function kernel) project the data into a higher-dimensional space where a linear separator exists, producing smooth curved boundaries in the original space. Neural networks, with their layers of nonlinear activations, can learn arbitrarily complex boundaries — curves, islands, and disconnected regions.

The shape of the decision boundary directly reveals the model's inductive bias — its built-in assumptions about the structure of the problem. A model with a linear boundary assumes the classes are linearly separable; if they are not, it will misclassify points near the boundary regardless of how much data you provide. A model with a highly flexible boundary can fit complex patterns but risks overfitting: the boundary may contort to accommodate noise in the training data, creating jagged or fragmented regions that do not generalize. Visualizing decision boundaries in 2D makes this tradeoff concrete — you can literally see a simple model underfitting by drawing too straight a line, and a complex model overfitting by carving out tiny islands around individual training points. This geometric intuition carries directly into higher dimensions, where the tradeoff between boundary complexity and generalization remains the central challenge of classification.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Linear Regression in Machine Learning → Decision Boundaries in Classification

Longest path: 92 steps · 626 total prerequisite topics

Prerequisites (2)

Leads To (1)