ComenzarEmpieza gratis

Binary predictions (2)

Let's continue to explore the predictions of our model.

Este ejercicio forma parte del curso

Helsinki Open Data Science

Ver curso

Instrucciones del ejercicio

  • Initialize the ggplot object and define probability as the x axis and high_use as the y axis.
  • Use geom_point() to draw the plot.
  • Add the aesthetic element col = prediction and draw the plot again.
  • Use table() to create a cross table of 'high_use' versus 'prediction'
  • Adjust the code: Use %>% to apply the prop.table() function on the output of table()
  • Adjust the code: Use %>% to apply the addmargins() function on the output of prop.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)


Editar y ejecutar código