Skip to content
Glacius
CalculusConcept reference

Level sets

The level set at c is the set of all domain inputs whose scalar output equals c.

On this page 9 sections
  1. Overview
  2. A level set collects all inputs that produce the same scalar output
  3. For f(x,y)=x^2+y^2, both (2,0) and (0,2) give 4
  4. To test a candidate, substitute it into the function and compare with the requested level
  5. A closer look
  6. Key takeaway
  7. Further questions
  8. Sources & further reading
  9. Concept connections

01A level set collects all inputs that produce the same scalar output#

A level set collects all inputs that produce the same scalar output. On a map, a contour joins places with the same height. For a model’s loss, a contour joins parameter settings with the same error. This lets us discuss several-variable functions without drawing a surface in a higher-dimensional space.

For f(x,y)=x2+y2f(x,y)=x^2+y^2, many inputs give 4. The circle marks all those inputs in the input plane.

Input plane for f(x,y)=x squared+y squared. The full teal circle is the level f=4. Its radius is 2 data units; equal horizontal and vertical scales are 30 pixels per unit. Points (2,0), (0,2), and (-2,0) lie on it; (0,0) has output 0. The plot shows inputs only.Input plane for f(x,y)=x squared+y squared. The full teal circle is the level f=4. Its radius is 2 data units; equal horizontal and vertical scales are 30 pixels per unit. Points (2,0), (0,2), and (-2,0) lie on it; (0,0) has output 0. The plot shows inputs only.
Figure 1Input plane for f(x,y)=x squared+y squared. The full teal circle is the level f=4. Its radius is 2 data units; equal horizontal and vertical scales are 30 pixels per unit. Points (2,0), (0,2), and (-2,0) lie on it; (0,0) has output 0. The plot shows inputs only.
Link to this figure ↗Download SVGDownload PNG

Choose one output cc. Its level set contains exactly the domain inputs that produce cc.

f(x,y)=cf(x,y)=c

For f(x,y)=x2+y2f(x,y)=x^2+y^2, the level 5 means solve x2+y2=5x^2+y^2=5. The point (1,2)(1,2) belongs because 1+4=51+4=5; (2,2)(2,2) does not because 4+4=84+4=8. A level set is a collection of inputs, while 5 is their common output.

Check your reasoning

f(x,y)=x+yf(x,y)=x+y, level c=5c=5. Which input belongs?

  1. A(5,1)(5,1)
  2. B(0,4)(0,4)
  3. C(2,3)(2,3)
Show answer and explanation
(2,3)(2,3)

Only (2,3)(2,3) gives 2+3=52+3=5.

02For f(x,y)=x^2+y^2, both (2,0) and (0,2) give 4#

For f(x,y)=x2+y2f(x,y)=x^2+y^2, both (2,0)(2,0) and (0,2)(0,2) give 4. The origin gives 0, so it is outside level 4. A level set fixes one output; the full graph records every input and its output.

Check your reasoning

f(x,y)=xyf(x,y)=xy, c=6c=6. Candidates: A(2,3)(2,3), B(1,6)(1,6), C(3,3)(3,3). Which qualify?

  1. AA and B
  2. BA only
  3. CA, B and C
Show answer and explanation
A and B

A and B give 6.

03To test a candidate, substitute it into the function and compare with the requested level#

To test a candidate, substitute it into the function and compare with the requested level. If a task lists candidates, check every one; that list need not describe the entire level set.

Check your reasoning

f(x,y)=x2+yf(x,y)=x^2+y, c=2c=2. Candidates: A(1,1)(1,1), B(1,1)(-1,1). Repair “A only”.

  1. AA only
  2. BA and B
  3. CB only
Show answer and explanation
A and B

Both inputs give 2.

04A closer look#

Contour plots of training loss show where different parameter choices perform equally under that loss. Moving along a contour preserves the plotted value; moving across contours changes it. A contour plot shows only the coordinates or slice specified by its axes.

Key takeaway

Fix one output; keep every input that produces it.

  • Identify inputs sharing the same scalar output.

Further questions

Is a level set the whole function graph?
No. A level set lives in input space and fixes one output. The full graph pairs every allowed input with its output.

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Level sets.” Math behind ML. /learn/c-level