As discussed in #502 and #646, score() can produce a lot of spurious warnings. We can get rid of some + make additional improvements by
passing the name of the function to run_safely() such that the warnings produces in there include the name of the function that caused them
stop exporting run_safely()
adapting apply_metrics() by changing the line forecast[, (metric_name) := do.call(run_safely, list(..., fun = fun))] with forecast[[metric_name]] <- do.call(run_safely, list(..., fun = fun)). The reason for this is that run_safely() returns NULL when the function execution fails. When using the data.table syntax this means that we try to remove a column that doesn't exist, which produces a warning.
As discussed in #502 and #646,
score()
can produce a lot of spurious warnings. We can get rid of some + make additional improvements byrun_safely()
such that the warnings produces in there include the name of the function that caused themrun_safely()
apply_metrics()
by changing the lineforecast[, (metric_name) := do.call(run_safely, list(..., fun = fun))]
withforecast[[metric_name]] <- do.call(run_safely, list(..., fun = fun))
. The reason for this is thatrun_safely()
returnsNULL
when the function execution fails. When using thedata.table
syntax this means that we try to remove a column that doesn't exist, which produces a warning.