Binary predictions (2)
Let's continue to explore the predictions of our model.
Este ejercicio forma parte del curso
Helsinki Open Data Science
Instrucciones del ejercicio
- Initialize the ggplot object and define
probabilityas the x axis andhigh_useas the y axis. - Use
geom_point()to draw the plot. - Add the aesthetic element
col = predictionand draw the plot again. - Use
table()to create a cross table of 'high_use' versus 'prediction' - Adjust the code: Use
%>%to apply theprop.table()function on the output oftable() - Adjust the code: Use
%>%to apply theaddmargins()function on the output ofprop.table()
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# alc is available
# access dplyr and ggplot2
library(dplyr); library(ggplot2)
# initialize a plot of 'high_use' versus 'probability' in 'alc'
g <- ggplot(alc, aes(x = "change me!", y = "change me!"))
# define the geom as points and draw the plot
# tabulate the target variable versus the predictions
table(high_use = alc$high_use, prediction = alc$prediction)