Leistung eines logistischen Modells messen
Eine Konfusionsmatrix als Tabellenobjekt zu haben, ist okay, aber etwas umständlich fürs Programmieren. Wenn du sie in ein yardstick-Konfusionsmatrix-Objekt umwandelst, bekommst du Methoden zum Plotten und zum Auslesen von Leistungskennzahlen.
Die Konfusionsmatrix outcomes liegt als Tabellenobjekt vor. ggplot2 und yardstick sind geladen, und die Option yardstick.event_first ist auf FALSE gesetzt.
Diese Übung ist Teil des Kurses
Einführung in Regression mit R
Anleitung zur Übung
- Wandle
outcomesin eine yardstick-Konfusionsmatrix um. Weisen sieconfusionzu. - Plotte
confusionautomatisch. - Hole Leistungskennzahlen aus
confusionund denke daran, dass die positive Antwort in der zweiten Spalte steht.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Convert outcomes to a yardstick confusion matrix
confusion <- ___
# Plot the confusion matrix
___
# Get performance metrics for the confusion matrix
___