plotRBPCurve | R Documentation |
plots the RBP curve
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,
...
)
obj |
[ |
main |
[ |
xlab |
[ |
ylab |
[ |
type |
[ |
ylim |
[ |
x.adj |
[ |
y.adj |
[ |
cond.axis |
[ |
title.line |
[ |
add |
[ |
... |
[any] |
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.