ramp.f

Share:

Description

computes ramp function value from paired difference of linear combinations

Usage

1
ramp.f (eta,s,loss=TRUE)

Arguments

eta

a vector of paired difference of linear combinations

s

absolute value of the slope parameter

loss

a boolean. If TRUE, return loss function i.e. 1 - RAUC. If FALSE, rturn RAUC. Default to TRUE, because we minimize loss.

Value

A vector of sames size as eta

Author(s)

Shuxin Yin
Youyi Fong youyifong@gmail.com
Krisztian Sebestyen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
dat = sim.dat.1(n=100,seed=1)
X1 = as.matrix(subset(dat, y==0, select=c(x1,x2)))
X2 = as.matrix(subset(dat, y==1, select=c(x1,x2)))
X.diff = get.X.diff (X1, X2)
dim(X1)
dim(X2)
dim(X.diff)
aux = ramp.f(X.diff %*% c(1,1), s=1)
length(aux)
mean(aux)
aux = ramp.f(X.diff %*% c(1,1), s=1, loss=FALSE)
length(aux)
mean(aux)