Description Usage Arguments Details Value Note Author(s) References See Also Examples
Model evaluation: lift chart
1 | lift.chart(prediction, labels, dec.point = 0.5, nclass = 10, colorize = T)
|
prediction |
predicted result (double) |
labels |
real target lable (binary) |
dec.point |
cut off point, default=.5 |
nclass |
Classifed in to n class, default=10 |
colorize |
whether use color, default=F |
Lift charts
Picture
Lift Charts
Yifan Yang
http://sweb.uky.edu/~yya234
AUC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (prediction, labels, dec.point = 0.5, nclass = 10, colorize = T)
{
if (nclass < 5) {
print("nclass should be larger than (or equals) 5")
nclass = 5
}
n <- length(labels)
if (length(prediction) != n) {
print("lengths of prediction and labels are different.")
return(F)
}
if (n < nclass) {
print("length of prediction should be larger than N-class.")
return(F)
}
if (n%%nclass == 0) {
col <- rainbow(nclass)
n.perclass <- n/nclass
pred.rate <- rep(0, nclass)
tmp <- as.integer(sort(prediction, decreasing = T) >
dec.point)
for (i in 1:nclass) {
pred.rate[]
}
}
else {
col <- rainbow(nclass) + 1
print("Extra 1 new class")
n.perclass <- as.integer(n/nclass)
n.res <- n%%nclass
pred.rate <- rep(0, nclass)
}
return(pred.rate)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.