slds-lmu / lecture_advml

Creative Commons Attribution 4.0 International
1 stars 2 forks source link

Add expression of 0-1-loss as cost-matrix from multiclass chapter #8

Open dandls opened 4 years ago

dandls commented 4 years ago

Add the following about 0-1-losses to cost sensitivity chapter

We can express the 0-1-loss by a cost-matrix $\mathbf{C} \in \R^{g \times g}$
  $$
  \mathbf{C} =  \left(\begin{array}{cccc}
    0 & 1 & \hdots & 1 \\
    1 & 0 & \hdots & 1 \\
    1 & 1 & \hdots & 1 \\
    \vdots & \vdots & \ddots & \vdots \\
    1 & 1 & \hdots & 0 \\
    \end{array}\right)\, = \mathbf{1} \mathbf{1}^\top - \left(\begin{array}{cccc}
      1 & 0 & \hdots & 0 \\
      0 & 1 & \hdots & 0 \\
      0 & 0 & \hdots & 0 \\
      \vdots & \vdots & \ddots & \vdots \\
      0 & 0 & \hdots & 1 \\
      \end{array}\right)\, 
    $$

      The entry $c_{ij}$ expresses how we weight the error if we classify $\hx = j$ but $y = i$. 

      \lz 

      In the case of the 0-1-loss, any type of misclassification is weighted equally.