Maths for ML / Notation

{x∣P(x)}\{x \mid P(x)\}

set-builder notation

SetsBeginner

Say it “the set of x such that…”

Describes a set by a rule: everything before the bar, filtered by the condition after it.

Example

{x∈R∣x>0}\{x \in \mathbb{R} \mid x > 0\}

All positive real numbers.

In code

[x for x in xs if x > 0]

Where you’ll see it in ML

Defining feasible regions and decision regions.

Don’t confuse it with

Lessons that use it

← All 94 symbols