generate.loss.huber: Generator for Huber Loss Function

View source: R/StatModels.R

generate.loss.huberR Documentation

Generator for Huber Loss Function

Description

This function generates and returns the Huber loss function used for privacy-preserving SVM at the specified value of h in the form required by EmpiricalRiskMinimizationDP.CMS.

Usage

generate.loss.huber(h)

Arguments

h

Positive real number for the Huber loss parameter. Lower values more closely approximate hinge loss. Higher values produce smoother Huber loss functions.

Value

Huber loss function with parameter h in the form required by EmpiricalRiskMinimizationDP.CMS.

Examples

  h <- 0.5
  huber <- generate.loss.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


DPpack documentation built on April 8, 2023, 9:09 a.m.