Closed cregouby closed 1 year ago
What if the inputs for spruce_prob_multi()
were expected to be the outputs from spruce_prob()
?
Like:
spruce_prob_multi(
spruce_prob(c("a", "b"), matrix(c(.3, .7, .4, .6), nrow = 2, byrow = TRUE)),
foo = spruce_prob(c("a", "b", "c"), matrix(c(.2, .7, .1, .2, .6, .2), nrow = 2, byrow = TRUE))
)
So spruce_prob_multi()
would take ...
, and if the dots are named like with foo
above then that would become the suffix after .pred_{suffix}
? If no name is given it would use the position like 1
or 2
.
It might make sense to make all of the spruce_*_multi()
functions take ...
in this way:
spruce_numeric_multi(...)
takes N
numeric vectors of the same sizespruce_class_multi(...)
takes N
factor vectors of the same sizespruce_prob_multi(...)
takes N
spruce_prob()
outputs of the same size That way they all have a somewhat consistent interface and we can apply the ...
suffix trick to all 3
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
Feature (this is a follow-up of #161)
In situations when models is multi-outcomes like prediction is a multi-horizon forecast or a multi-output prediction in
hardhat::spurce_*_multi
commands.Reprex
see the Reprex in #161
Proposed API
The API proposed by @DavisVaughan in #161 is fine for me:
But the API for
spruce_prob_multi()
need some clarification :This opens questions for the inputs of the
spruce_prob_multi()
functions.My initial thought was to generalize the
spruce_prob()
inputs but this fails with the example provided where the 2 outcomes have respectively 2 and 3 levels (which is an expected situation) as we cannot have a dataframe of thepred_levels
vector of unequal size :As there is low chance of that the multi-outcomes factors may have the same number of levels. So there is no chance to make them all reside in a
pred_levels_df
input:What do you think could be the input type for
prob_levels_df