Closed frankiethull closed 1 year ago
Hey @frankiethull,
Thanks a lot for this effort. Once you have it working, please let us know. We will gladly include a tutorial in the documentation.
Regarding your bug, I would respect the types in the instantiation of the models.
For instance, you declare input_size=(2 * horizon)
as a tuple with an integer rather than an integer input_size=2 * horizon
.
Or try to coerce the type of 2*horizon
to be an integer because this parameter defines the model's dimensions and cannot receive a float.
Hi @kdgutier - thanks for the quick reply. Hopefully I can get something working then!
I have tried things like:
nf$models$NBEATS
(input_size=2 * horizon
, h=horizon, max_steps=50)
nf$models$NBEATS(input_size=2*horizon
, h=horizon, max_steps=50)
nf$models$NBEATS(input_size=(2*horizon)
, h=horizon, max_steps=50)
nf$models$NBEATS(input_size=24
, h=horizon, max_steps=50)
or going one step further into submodules:
nf$models$nbeats$NBEATS
(input_size=2 * horizon
, h=horizon, max_steps=50)
But all return the same error which I am surprised. My initial PoC with with statsforecast's AutoARIMA and I did not have the type errors.
Can you try using as.integer(2 * horizon)
?
That worked!!!
tuple / float issue on R side fixed using as.integer()
@frankiethull, If you have the example running, adding it to a tutorial in the documentation would be super cool. I can gladly help with that. Let me know.
@kdgutier, I was thinking about creating a library for this (basically a few helper fcns). But until then, here's a quick tutorial of setup + use case based on the air passengers dataset (cleaned up code from above).
https://github.com/frankiethull/nixtla-r-tutorial
Let me know what you think and I am more than happy to work on more of these with you all. In addition, let me know what your thoughts are on the R extension library and if that would be something you would like to collaborate on. 90% of my time is spent in R so I know a lot of us R programmers would like to use the current and future nixtla algos. Appreciate your help today
@kdgutier - I kept the original setup tutorial (nixtla_r_tutorial.md) but see the new readme doc here:
https://github.com/frankiethull/nixtla-r-tutorial
I created helper functions for using neuralforecast via R. Have yet to pkg but think this works pretty well for a lite and easy implementation for my uses.
Let me know how you'd like to proceed on adding a tutorial on your end and I can test more on the R side.
Description
nixtlaR test
fth
Porting over NBEATS, NBEATSx, and NHITS to R
first, running the python example from here: https://pypi.org/project/neuralforecast/
porting over to R with reticulate
ideas for bridging and porting to R from python, these would be handled in the library so that it is easy to wrap with NBEATS, or NHITS:
data split in R:
The Issue:
although, could train models in python and reference like so, but would like advice on creating
models
object without a tuple error.Use case
I'm looking to leverage the current python model APIs within R via reticulate. Using reticulate should make it easy but ran into an issue with tuples . Looking for advice to create the proper model objects without running a python code chunk. The issue seems to be with the format of input_size but wasn't able to force the creation of the model objects. "argument 'size' must be tuple of ints, but found element of type float at pos 2"