Aan de slagGa gratis aan de slag

Measuring logistic model performance

Having the confusion matrix as a table object is OK, but a little hard to program with. By converting this to a yardstick confusion matrix object, you get methods for plotting and extracting performance metrics.

The confusion matrix, outcomes is available as a table object. ggplot2 and yardstick are loaded, and the yardstick.event_first option is set to FALSE.

Deze oefening maakt deel uit van de cursus

Introduction to Regression in R

Cursus bekijken

Oefeninstructies

  • Convert outcomes to a yardstick confusion matrix. Assign to confusion.
  • Automatically plot confusion.
  • Get performance metrics from confusion, remembering that the positive response is in the second column.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Convert outcomes to a yardstick confusion matrix
confusion <- ___

# Plot the confusion matrix
___

# Get performance metrics for the confusion matrix
___
Code bewerken en uitvoeren