Questions tagged [hinge-loss]

6 questions
5
votes
1 answer

Visualizing the hinge loss and 0-1 loss

I have seen the plot below in many textbooks before. What do the X axis and the Y axis represent exactly? What does it mean for the Hinge loss to "touch" the 0-1 loss on the (x,y) pair (0,1)? If helpful, the source of this picture is from the entry…
Josh
  • 3,408
  • 4
  • 22
  • 46
2
votes
1 answer

Hinge loss in SVM

I've saw the following definition of hinge loss, in the case of multiclass classification, using a delta term. $$ L({W}) = \frac{1}{N} \sum_{i=1}^{N} L_{i}({W}) + \frac{\lambda}{2} ||{{W}}||^2 $$ $$ L_{i}({W}) = \sum_{j \neq y_i} \max\left(0,…
Maverick Meerkat
  • 2,147
  • 14
  • 27
1
vote
1 answer

How to create Hinge loss function in python from scratch?

I am learning the math behind popular loss functions by trying to hard code all loss functions from scratch. I tried to code hinge loss My code def hinge_fun(actual, predicted): # replacing 0 = -1 new_predicted = np.array([-1 if i==0 else i…
1
vote
0 answers

Hinge loss is the tightest convex upper bound on the 0-1 loss

I have read many times that the hinge loss is the tightest convex upper bound on the 0-1 loss (e.g. here, here and here). However, I have never seen a formal proof of this statement. How can we formally define the hinge loss, 0-1 loss and the…
durdi
  • 160
  • 1
  • 4
1
vote
0 answers

How to differentiate the hinge loss?

I'm asked to differentiate the following hinge loss term. $$ \dfrac{1}{n}\sum _{\left( x_{i},y_{1}\right) \in S}\sum _{j'=1}L\left( w^{j'};\left( x_{i},y_{i}\right) \right) $$ where $$ L\left( w^{j'};\left( x_{i},y_{i}\right) \right) = ( \max \{…
WindBreeze
  • 131
  • 4
0
votes
0 answers

Compute hinge loss just for the positive class in tensorflow

How to implement hinge loss only for positive class in Tensorflow? I have binary classification task so the output is one-hot encoding of the label. So given out (Tensor of shape (batch_size,2)) and target (Tensor of shape (batch_size,2)) how to…
Siddhi
  • 1