Open mzorko opened 4 years ago
Looks like a bug! Do the multiclass (>2) models behave properly?
I didn't look into multiclass models in detail so far. I was playing with this small example and for
n > 2
I couldn't find any problems. For n = 2
probabilities are always swapped.
n <- 2
xgb_tbl <- data.frame(x = sample(1:n, 100, replace = TRUE)) %>%
mutate(target = LETTERS[x]) %>%
sdf_copy_to(sc, ., overwrite = TRUE)
xgboost_classifier(
xgb_tbl, target ~ ., num_class = n, num_round = 50, max_depth = 6) %>%
ml_predict(xgb_tbl) %>% group_by(x, predicted_label) %>% count %>%
arrange(x) %>% collect() %>% data.frame()