ramp.f: ramp.f

Description Usage Arguments Value Author(s) Examples

View source: R/get_K_Q.R View source: R/rauc.R

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)

aucm documentation built on Jan. 11, 2020, 9:43 a.m.

Related to ramp.f in aucm...