Open nikosbosse opened 1 month ago
Attention: Patch coverage is 73.62637%
with 24 lines
in your changes missing coverage. Please review.
Project coverage is 94.25%. Comparing base (
b58434e
) to head (3ba8a46
). Report is 19 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
R/score.R | 0.00% | 16 Missing :warning: |
R/default-scoring-rules.R | 0.00% | 4 Missing :warning: |
R/check-inputs-scoring-functions.R | 92.00% | 2 Missing :warning: |
R/forecast.R | 96.15% | 1 Missing :warning: |
R/metrics-nominal.R | 87.50% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
This PR closes #604.
Nominal forecasts are forecasts for outcomes that can fall in one of several unordered categories. This PR implements support for nominal forecasts (see #604, #607, and #608).
Specifically, the PR
nominal_forecast
class withassert_input_nominal
function that checks the inputs passed to a scoring functioncheck_input_nominal
, doing the same thing without producing an errorassert_forecast.forecast_nominal
function, checking that a data.table is complying with the required input formatmetrics_nominal
score.forecast_nominal
as_forecast()
to accept a newpredicted_label
argument.get_forecast_type()
and adds a check function to make sure that the forecast type is nominalNote: Throughout the process, I noticed that sadly, scoringutils is currently not "easily extensible"... To make this go smoothly, there are quite a few hoops. Some of this will be simplified in the future when we implement a separate
as_forecast_nominal()
function instead of a singleas_forecast()
function that has to do all the guesswork.Still missing (likely for a future PR)
One current code example:
Checklist
lintr::lint_package()
to check for style issues introduced by my changes.