When we define our error e^i

in our expression e^i=max(o,1-t^i),
why do we write max in it

Hello @sankalparora5,

We wanted the response variable to be < 0 when it belongs to class A and > 0 when it belongs to class B.
Hence, as you may know, when minimizing the squared value of the parameter W, we minimize it subject to ti (W*x+b) >= 1, where ti is -1 if x belongs to class A and 1 otherwise.
So for correct classification, this expression will always stand true.
Now, when we wanted this behaviour to be in the final loss function and for that we came up with a loss called Hinge loss which is given by, max(0, 1-ti) here, ti is yi(W*x+b).

What this means is, according to the hinge loss, if the classification is wrong, i.e the value of ti < 0 for class A then max(0, 1-ti) will have a positive value which is added to the loss increasing it. But if the classification is correct, then ti < 0 implies, max(0, 1-ti) = 0. Remember max(0, with a negative number) = 0. Hence this loss implements the behaviour we wanted.

Hope this cleared you doubt.

Happy Learning :slightly_smiling_face: