hinge_pred
computes the in-sample hinge loss, given a set of predictions. hinge_w
computes predictions, and passes these to hinge_pred
to compute the in-sample hinge loss.
1 2 3 | hinge_pred(pred, y, m = 1)
hinge_w(w, X, ...)
|
pred |
y predictions from the model w |
y |
outcome vector, with elements -1 or 1 |
m |
margin parameter |
w |
weight vector (linear classification model). First element should be an interecept term. For example, the output of |
X |
covariate matrix, should not include a constant (intercept) column. |
... |
passed to hinge_pred |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.