Skip to content

Commit

Permalink
make criteria to classify a forecast as binary stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse committed Mar 15, 2021
1 parent 04d85d2 commit ec3fdf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/eval_forecasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ eval_forecasts <- function(data = NULL,
}

if (all.equal(data$true_value, as.integer(data$true_value)) == TRUE) {
if (all(data$true_value %in% c(0,1))) {
if (all(data$true_value %in% c(0,1)) && all(data$prediction >= 0) && all(data$prediction <= 1)) {
target_type = "binary"
} else {
target_type = "integer"
Expand Down

0 comments on commit ec3fdf5

Please sign in to comment.