Calculation summary
No calculation yetInteractive visualizations
Data and calculation settings
Model diagnostics
Diagnostic findings
Class and split comparison
Detailed results table
| Prediction | Classification | Margin status | Model | Split |
|---|
Export and sharing
Formula used
Standard hinge loss: Li = max(0, m − yif(xi))
Squared hinge loss: Li = max(0, m − yif(xi))2
Modified Huber: 0 when margin ≥ m; (m − margin)2 inside the transition; linear beyond the negative margin.
Regularized objective: C × aggregated loss + ½λ||w||2
Squared hinge loss: Li = max(0, m − yif(xi))2
Modified Huber: 0 when margin ≥ m; (m − margin)2 inside the transition; linear beyond the negative margin.
Regularized objective: C × aggregated loss + ½λ||w||2
How to use
- Enter labels, decision scores, weights, models, and dataset splits.
- Select a hinge-family loss and adjust the margin threshold.
- Choose curve ranges, graph styling, precision, and visibility controls.
- Calculate the results and inspect margin violations or misclassifications.
- Switch visualization tabs to compare classes, epochs, and models.
- Export the chart, table, graph data, or printable report.
Worked example
| Actual label | Decision score | Signed margin | Standard loss | Interpretation |
|---|---|---|---|---|
| +1 | 1.6 | 1.6 | 0 | Correct and outside the margin |
| +1 | 0.4 | 0.4 | 0.6 | Correct but inside the margin |
| −1 | 0.3 | −0.3 | 1.3 | Misclassified with a larger penalty |
Interpretation guide
- Zero loss: The sample is correctly classified beyond the required margin.
- Positive loss: The sample violates the margin or is misclassified.
- Signed margin: Positive values indicate correct classification direction.
- Large negative margin: The prediction is confidently wrong.
- Sample weight: Larger weights increase that observation's contribution.
- Squared hinge: Larger violations receive substantially stronger penalties.
- Regularization: Larger values favor simpler parameter configurations.
Frequently asked questions
What is hinge loss?
Hinge loss penalizes incorrect classifications and insufficient classification margins.
Why can a correct prediction have loss?
A prediction can be correct but remain inside the required margin.
Which models commonly use hinge loss?
Support vector machines and large-margin linear classifiers commonly use it.
What does the margin threshold control?
It sets the signed-margin level required for zero loss.
How is squared hinge loss different?
It squares violations and emphasizes samples with larger errors.
Can this calculator handle imbalanced classes?
Yes. Use sample weights to increase minority-class influence.
How does one-versus-rest mode work?
The chosen class becomes positive and every other class becomes negative.
What do negative signed margins mean?
They indicate that the predicted direction disagrees with the true class.
Can several models be compared?
Yes. Add model names to rows and open model comparison.