tft icon indicating copy to clipboard operation
tft copied to clipboard

Cannot find the electricity dataset

Open binh0206 opened this issue 2 years ago • 6 comments

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!

binh0206 avatar Apr 13 '23 20:04 binh0206

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

dfalbel avatar Apr 13 '23 20:04 dfalbel

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!

binh0206 avatar Apr 13 '23 20:04 binh0206

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

dfalbel avatar Apr 14 '23 11:04 dfalbel

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?

binh0206 avatar Apr 14 '23 14:04 binh0206

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.

dfalbel avatar Apr 14 '23 14:04 dfalbel

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!

binh0206 avatar Apr 14 '23 16:04 binh0206