Probability and statistics

1[y=k]\mathbb{1}[y = k] Indicator function

1 when the condition inside is true, 0 when it is false.

In ML papers

1[condition]\mathbb{1}[\text{condition}] is 1 if the condition holds and 0 otherwise. It turns a test into a number you can sum: โˆ‘i1[y^i=yi]\sum_i \mathbb{1}[\hat{y}_i = y_i] counts correct predictions, and the one-hot label is yk=1[y=k]y_k = \mathbb{1}[y = k].

Other meanings, by context

How to type it

LaTeXShows
\mathbb{1}[y = k]1[y=k]\mathbb{1}[y = k]
\mathbf{1}\{y = k\}1{y=k}\mathbf{1}\{y = k\}

A worked example

โˆ‘i=141[y^i=yi]=1+0+1+1=3\sum_{i=1}^{4} \mathbb{1}[\hat{y}_i = y_i] = 1 + 0 + 1 + 1 = 3

Three of four predictions are right: accuracy 3/43/4.

Related

โˆ‘i=1Nxi\sum_{i=1}^{N} x_iSummationf(x)={xx>00otherwisef(x) = \begin{cases} x & x > 0 \\ 0 & \text{otherwise} \end{cases}Cases (piecewise)D={(xi,yi)}i=1N\mathcal{D} = \{(\mathbf{x}_i, y_i)\}_{i=1}^{N}Set braces

Decode this example โ†’