finnts icon indicating copy to clipboard operation
finnts copied to clipboard

Error running Radme code

Open MislavSag opened this issue 1 year ago • 3 comments

I have just installed the package and tried smaple code from GitHub Readme:

library(finnts)

# prepare historical data
hist_data <- timetk::m4_monthly %>%
  dplyr::rename(Date = date) %>%
  dplyr::mutate(id = as.character(id))

# call main finnts modeling function
finn_outp33ut <- forecast_time_series(
  input_data = hist_data,
  combo_variables = c("id"),
  target_variable = "value",
  date_type = "month",
  forecast_horizon = 3,
  back_test_scenarios = 6, 
  models_to_run = c("arima", "ets"), 
  run_global_models = FALSE, 
  run_model_parallel = FALSE
)

I get an error

Finn Submission Info
• Experiment Name: finn_fcst
• Run Name: finn_fcst-20240228T132002Z

✔ Prepping Data [15.9s]                                                                                                            
✔ Creating Model Workflows [1.4s]                                                                                                  
✔ Creating Model Hyperparameters [1.3s]                                                                                            
ℹ Turning ensemble models off since no multivariate models were chosen to run.                                                     
✔ Creating Train Test Splits [9.7s]                                                                                                
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard                         
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard                         
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard                         
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ B | warning: A correlation computation is required, but `estimate` is constant and has 0 standard deviation,
               resulting in a divide by 0 error. `NA` will be returned.
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ B | warning: A correlation computation is required, but `estimate` is constant and has 0 standard deviation,
               resulting in a divide by 0 error. `NA` will be returned.
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard                         
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
✔ Training Individual Models [2m 42.3s]
ℹ Ensemble models have been turned off.                                                                                            
✔ Training Ensemble Models [239ms]
Error in { : task 3 failed - "subscript out of bounds"                                                                             
In addition: Warning messages:
1: In guerrero(x, lower, upper) :
  Guerrero's method for selecting a Box-Cox parameter (lambda) is given for strictly positive data.
2: In guerrero(x, lower, upper) :
  Guerrero's method for selecting a Box-Cox parameter (lambda) is given for strictly positive data.
3: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
4: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
5: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
6: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
7: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
8: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
9: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
10: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
✖ Selecting Best Models [1.2s]

MislavSag avatar Feb 28 '24 13:02 MislavSag

Hey @MislavSag can you please let me know what version of R you are using?

mitokic avatar Mar 14 '24 17:03 mitokic

I am on latest version, 4.3.3. I have updateded all packages including fnints, but still getting an error:

Finn Submission Info
• Experiment Name: finn_fcst
• Run Name: finn_fcst-20240321T113248Z

✔ Prepping Data [14.5s]                                                                                                           
✔ Creating Model Workflows [1.6s]                                                                                                 
✔ Creating Model Hyperparameters [1.6s]                                                                                           
ℹ Turning ensemble models off since no multivariate models were chosen to run.                                                    
✔ Creating Train Test Splits [10.2s]                                                                                              
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard                        
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard                        
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard                        
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ B | warning: A correlation computation is required, but `estimate` is constant and has 0 standard
               deviation, resulting in a divide by 0 error. `NA` will be returned.
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ B | warning: A correlation computation is required, but `estimate` is constant and has 0 standard
               deviation, resulting in a divide by 0 error. `NA` will be returned.
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard                        
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
→ A | warning: A correlation computation is required, but the inputs are size zero or one and the standard
               deviation cannot be computed. `NA` will be returned.
There were issues with some computations   A: x1
✔ Training Individual Models [2m 32.1s]
ℹ Ensemble models have been turned off.                                                                                           
✔ Training Ensemble Models [266ms]
Error in { : task 3 failed - "subscript out of bounds"                                                                            
In addition: Warning messages:
1: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
2: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
3: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
4: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
5: More than one set of outcomes were used when tuning. This should never happen. Review how the outcome is specified in your model. 
✖ Selecting Best Models [1.1s]

MislavSag avatar Mar 21 '24 11:03 MislavSag

Hmm this is a strange error, since this is the same code that runs as tests every day in CRAN. So in theory it should work. I would suggest checking if the finnts dependencies are old on your machine, and update them if needed. Also maybe try using another data set. For example the quarterly data set from timetk instead.

https://business-science.github.io/timetk/reference/index.html#time-series-datasets

mitokic avatar Apr 10 '24 20:04 mitokic