You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In batch processing consistency is king. Sometimes we might apply filter on a dataset and remove all the data. Still calling model on such a tsibble should, in my opinion, not produce an error but return an empty mable. This allows us to write simple and consistent pipelines without unnecessary error checking.
This works:
> tsibble(i=1:12, quantity=1, index="i") %>% filter(i>1) %>% model(x= MEAN(quantity))
# A mable: 1 x 1x<model>1<MEAN>> tsibble(i=1:12, quantity=1, index="i") %>% filter(i>12) %>% model(x= MEAN(quantity))
# A mable: 1 x 1x<model>1<NULLmodel>Warningmessage:1errorencounteredforx
[1] Allobservationsaremissing, amodelcannotbeestimatedwithoutdata.
With the current release versions of tsibble, feasts, fable and fabletools, I am getting the error for both the second and third lines above, rather than a <NULL model> for the second.
Perhaps a recent change to fabletools is keeping the second example from getting through to the fable::MEAN(), which creates the <NULL model> in response to:
if (all(is.na(y))) {
abort("All observations are missing, a model cannot be estimated without data.")
}
It seems like fabletools::estimate() might be a decent place for a check that calls null_model() in the face of no data, as I cannot conceive of a model that will fit without data, but my lack of imagination might be showing itself.
This should return a zero-row mable, but would require some restructuring of how and where some attributes like response variable are stored. Currently the response variables are grabbed from the estimated models, but in a zero-row mable there are no models to grab from.
In batch processing consistency is king. Sometimes we might apply
filter
on a dataset and remove all the data. Still callingmodel
on such a tsibble should, in my opinion, not produce an error but return an empty mable. This allows us to write simple and consistent pipelines without unnecessary error checking.This works:
but having a tsibble with key fails:
The text was updated successfully, but these errors were encountered: