factor_levels <- c("one", "two", "three")
predicted_label <- factor(c("one", "two", "three"), levels = factor_levels)
observed <- factor(c("one", "three", "two"), levels = factor_levels)
predicted <- matrix(
c(0.8, 0.1, 0.1,
0.1, 0.2, 0.7,
0.4, 0.4, 0.2),
nrow = 3,
byrow = TRUE
)
logs_categorical(observed, predicted, predicted_label)
Run the code above in your browser using DataLab