# NOT RUN {
df <- iris
df$isVersicolor <- with(df, Species=='versicolor')
model = glm(isVersicolor ~ Petal.Length + Petal.Width + Sepal.Length + Sepal.Width,
data=df, family=binomial)
df$pred = predict(model, newdata=df, type="response")
WVPlots::PRTPlot(df, "pred", "isVersicolor", TRUE, title="Example Precision-Recall threshold plot")
WVPlots::PRTPlot(df, "pred", "isVersicolor", TRUE,
plotvars = c("sensitivity", "specificity", "false_positive_rate"),
title="Sensitivity/specificity/FPR as functions of threshold")
# }
Run the code above in your browser using DataLab