generate.loss.gr.huber | R Documentation |
This function generates and returns the Huber loss function gradient used for
privacy-preserving SVM at the specified value of h in the form required by
EmpiricalRiskMinimizationDP.CMS
.
generate.loss.gr.huber(h)
h |
Positive real number for the Huber loss parameter. Lower values more closely approximate hinge loss. Higher values produce smoother Huber loss functions. |
Huber loss function gradient with parameter h in the form required by
EmpiricalRiskMinimizationDP.CMS
.
h <- 1
huber <- generate.loss.gr.huber(h)
y.hat <- c(-.5, 1.2, -0.9)
y <- c(-1, 1, -1)
huber(y.hat,y)
huber(y.hat, y, w=c(0.1, 0.5, 1)) # Weights observation-level loss gradient
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.