
For a set of margin
function measures the size of the gap between the classes. This is the
distance between the observation of response class zero having the
lowest value, and the individual of with response one having the
highest value.
margin(x, resp)
Numeric vector of length
Numeric vector of length 0
and 1
.
A numeric value, the margin
. Positive margin
indicates perfect separation of the response classes, whereas negative
margin
means imperfect separation.
see those in wilma
.
# NOT RUN {
data(leukemia, package="supclust")
op <- par(mfrow=c(1,3))
plot(leukemia.x[,69],leukemia.y)
title(paste("Margin = ", round(margin(leukemia.x[,69], leukemia.y),2)))
## Sign-flipping is very important
plot(leukemia.x[,161],leukemia.y)
title(paste("Margin = ", round(margin(leukemia.x[,161], leukemia.y),2)))
x <- sign.flip(leukemia.x, leukemia.y)$flipped.matrix
plot(x[,161],leukemia.y)
title(paste("Margin = ", round(margin(x[,161], leukemia.y),2)))
par(op)
# }
Run the code above in your browser using DataLab