mlverse / tft

R implementation of Temporal Fusion Transformers
https://mlverse.github.io/tft/
Other
26 stars 9 forks source link

Cannot find the electricity dataset #42

Open binh0206 opened 1 year ago

binh0206 commented 1 year ago

I am a newbie in R. I hope to receive the help. When I ran the electricity example code, I got an error for electricity dataset, in which electricity::electricity_hourly. I tried to apply install.packages("electricity"), but the error persists. I search in this repository, but I see no questions related. Therefore, I assume it is because of my set up. I use R version 4.2.3, R-Studio 2023.03.0 build 386. I had all required library installed. Would you mind helping to fix this error? Thank you so much!

dfalbel commented 1 year ago

Hi, sorry, you currently need to install it from github: remotes::install_github("dfalbel/electricity")

binh0206 commented 1 year ago

Thank you so much for your rapid response! The error is fixed. However, I apologize to bother you one more time for step_include_roles(). The error is Error in step_include_roles(.) : could not find function "step_include_roles", I saw this function showed only one time in this entire repository without function definition. Would you please help? Thank you so much!

dfalbel commented 1 year ago

What happens if you just discard it? I think I might have experimented with it but ended up removing.

binh0206 commented 1 year ago

Thanks for your response! Then, another error pops up is for function called tft. I replaced tft with tft::temporal_fusion_transformer. then, it causes another error such as

Error in fun(..., .envir = .envir): ! Could not evaluate cli {} expression: class(dataset). Caused by error in eval(expr, envir = envir): ! object 'dataset' not found

I think it is because the parameters cannot be rec and elec_train, but it should be spec only with spec <- tft_dataset_spec(rec, elec_train).

Is it correct?

dfalbel commented 1 year ago

Sorry, I would need to run the example to figure out. Have you tried looking at the differences between that electricity example and the one in: https://mlverse.github.io/tft/articles/Getting-started.html

Probably should help to know what's happening. Unfortunatelly this package is not in the state we wanted. There are some missing parts and the documentation is still sparse.

binh0206 commented 1 year ago

Thanks for your response! Yes, I ran the code in Getting-started.html before, and it worked great without any errors. Therefore, I thought the reason is because the code has not converted elec_train to torch::dataset() using tft_dataset_spec.

Also, in tft::temporal_fusion_transformer, I think function tft::temporal_fusion_transformer only needs torch::dataset(), not both rec and elec_train.

I will try to work around to find the way to fix that error based on Gettiing-started.html. If you have an opportunity to test the code again and fix it, please let me know! Thank you so much!