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

Overfitting, Underfitting, and Model Capacity

Graduate Depth 92 in the knowledge graph ☐ I know this ☆ Set as goal
23topics build on this
572prerequisites beneath it
See this on the map →
Bias-Variance TradeoffSupervised Learning Fundamentals→→Cross-Validation TechniquesRegularization Techniques
overfitting underfitting generalization

Core Idea

Overfitting occurs when a model memorizes training data and fails to generalize; underfitting means the model is too simple to capture patterns. Model capacity—determined by parameters and architecture—must match problem complexity. Detecting overfitting requires separate validation data and monitoring the train-validation gap.

Explainer

From the bias-variance tradeoff, you know that prediction error comes from two sources: bias (systematic inaccuracy from overly simple assumptions) and variance (sensitivity to the particular training data you happened to draw). Overfitting and underfitting are the practical manifestations of this tradeoff. Understanding them transforms the bias-variance concept from theory into a diagnostic you can apply to every model you build.

Underfitting means your model cannot capture the real patterns in the data. Imagine fitting a straight line to data that follows a parabola — no matter how much data you collect, the line will systematically miss the curve. The model's capacity (its ability to represent complex functions) is too low for the problem. Underfitting shows up as poor performance on *both* the training data and new data. The fix is straightforward: use a more flexible model, add features, or reduce excessive regularization. You can usually spot underfitting immediately because training accuracy itself is disappointing.

Overfitting is subtler and more dangerous. Here the model has *too much* capacity relative to the amount of training data. Instead of learning the underlying pattern, it memorizes noise — the random fluctuations specific to your particular training set. A polynomial of degree 50 can pass exactly through 50 data points, achieving zero training error, while making absurd predictions between those points. The telltale signature is a gap: training performance is excellent, but validation performance is significantly worse. The model has learned to ace the exam by memorizing answers rather than understanding the subject.

The key diagnostic tool is the training-validation gap. You split your data, train on one portion, and evaluate on the held-out portion. If both errors are high, you are underfitting. If training error is low but validation error is high, you are overfitting. If both are low and close together, your model's capacity is well-matched to the problem. During training, you can plot both curves over time: the training loss typically decreases steadily, while the validation loss decreases at first (the model is learning real patterns) and then starts increasing (the model is beginning to memorize noise). The point where validation loss begins to climb is the sweet spot — training beyond it buys you nothing on new data and actively hurts generalization. This monitoring discipline, combined with techniques like regularization and early stopping, is what separates models that perform well in the lab from models that perform well in the real world.

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 → Variance and Standard Deviation of Random Variables → Bias-Variance Tradeoff → Overfitting, Underfitting, and Model Capacity

Longest path: 93 steps · 572 total prerequisite topics

Prerequisites (2)

Leads To (2)