I am trying to get a grasp on what is the purpose of the loss function and I can't quite understand it.
So, as far as I understand loss function is for introducing some kind of metric that we can measure the "cost" of an incorrect decision with.
So let's say I have a dataset of 30 objects, I divided them to training / testing sets like 20 / 10. I will be using 0-1 loss function, so lets say my set of class labels is M and the function looks like this:
$$ L(i, j) = \begin{cases} 0 \qquad i = j \\ 1 \qquad i \ne j \end{cases} \qquad i,j \in M $$
So I built a model on my training data, say, using Naive Bayes classifier, and this model classified 7 objects correctly (assigned them the correct class labels) and 3 objects incorrectly.
So my loss function would return "0" 7 times and "1" 3 times - what kind of information can I get from that? That my model classified 30% of the objects incorrectly? Or is there more to it?
If there are any mistakes in my way of thinking I am very sorry, I am just trying to learn. If the example I provided is "too abstract", let me know, I'll try to be more specific. If you wish to explain the concept using a different example, please use 0-1 loss function.