factor_levels <- c("one", "two", "three")
predicted_label <- factor(factor_levels, levels = factor_levels, ordered = TRUE)
observed <- factor(c("three", "three", "two"), levels = factor_levels, ordered = TRUE)
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
)
rps_ordinal(observed, predicted, predicted_label)
Run the code above in your browser using DataLab