plotRBPCurve {RBPcurve} | R Documentation |
Plot residual-based predictiveness (RBP) curve.
Description
plots the RBP curve
Usage
plotRBPCurve(obj, main = "RBP Curve", xlab = "Cumulative Percentage",
ylab = "Estimated Residuals", type = "l", ylim = c(-1, 1.2),
x.adj = c(NA, -0.5), y.adj = c(NA, NA), cond.axis = FALSE,
title.line = ifelse(cond.axis, 3, 2), add = FALSE, ...)
Arguments
obj |
[ |
main |
[ |
xlab |
[ |
ylab |
[ |
type |
[ |
ylim |
[ |
x.adj |
[ |
y.adj |
[ |
cond.axis |
[ |
title.line |
[ |
add |
[ |
... |
Examples
# Download data
mydata = getTaskData(pid.task)
head(mydata)
# Build logit model and plot RBP curve
mylogit <- glm(diabetes ~ ., data = mydata, family = "binomial")
y = mydata$diabetes
pred1 = predict(mylogit, type="response")
obj1 = makeRBPObj(pred1, y)
plotRBPCurve(obj1, cond.axis = TRUE, type = "b")
## Not run:
# Build logit model using mlr and plot RBP curve
task = pid.task
lrn = makeLearner("classif.logreg", predict.type = "prob")
tr = train(lrn, task)
pred2 = getPredictionProbabilities(predict(tr, task))
obj2 = makeRBPObj(pred2, y)
plotRBPCurve(obj2, cond.axis = TRUE, type = "b", col = 2)
## End(Not run)
[Package RBPcurve version 1.2 Index]