VolpeUSDOT / RDR-Public

Public Version of the Resilience and Disaster Recovery Tool Suite
Other
5 stars 2 forks source link

Regression Error #12

Open rhaefer opened 1 month ago

rhaefer commented 1 month ago

I'm setting up the RDR quickstart and the model runs but then I get an error on the regression step. Any idea what's going on?

07-18 09:22:01 INFO Start: regression module 07-18 09:22:06 ERROR R PROCESS: 'Trying Gaussian process regression' 07-18 09:22:06 ERROR R PROCESS: 'Trying Gaussian process regression' 07-18 09:22:06 ERROR METAMODEL R CODE ERROR: rdr_Regression_Report_Compile.R encountered an error !!!!!!!!!!!!!!!!!!!! EXCEPTION RAISED !!!!!!!!!!!!!!!!!!!!!! Traceback (most recent call last): File "C:\GitHub\RDR\metamodel_py\Run_RDR.py", line 172, in main main(input_folder, output_folder, cfg, logger) File "C:\GitHub\RDR\metamodel_py\rdr_Metamodel.py", line 55, in main raise Exception("METAMODEL R CODE ERROR: rdr_Regression_Report_Compile.R encountered an error") Exception: METAMODEL R CODE ERROR: rdr_Regression_Report_Compile.R encountered an error

dflynn-volpe commented 1 month ago

Hm, thanks for flagging this. Can you share the content of the log file rr_log_QS1_<date>.log in Data > generated_files > logs? It may have some more details.

rhaefer commented 1 month ago

Hey Dan

07-18 08:57:22.081 INFO ========================================================================= 07-18 08:57:22.081 INFO ============== RDR RUN STARTING. Run Option = RR ==================== 07-18 08:57:22.081 INFO ========================================================================= 07-18 08:57:22.271 INFO Start: check_roi_required_inputs 07-18 08:57:22.482 INFO ROI analysis type is BCA: looking for actual project costs and hazard probabilities 07-18 08:57:22.482 INFO Finished: check_roi_required_inputs 07-18 08:57:22.501 INFO Running metamodel 07-18 08:57:22.501 INFO Start: regression module 07-18 08:57:29.504 ERROR R PROCESS: 'Trying Gaussian process regression' 07-18 08:57:29.504 ERROR R PROCESS: 'Trying Gaussian process regression' 07-18 08:57:29.504 ERROR METAMODEL R CODE ERROR: rdr_Regression_Report_Compile.R encountered an error

rhaefer commented 1 month ago

Is the issue related to the directories in 'rdr_Metamodel_Regression.Rmd'? Do these need to be modified? I'm using a directory structure with 'C:/GitHub/RDR' as the root directory. I don't see a 'SampleRun' subdirectory...

Screenshot 2024-07-18 100157

dflynn-volpe commented 1 month ago

No, those are parameters which come from the run config file, and are passed to the RMarkdown here: https://github.com/VolpeUSDOT/RDR-Public/blob/7144ec3a0ae53cc5caf082fe358f33be982517d4/metamodel_py/rdr_Regression_Report_Compile.R#L21

The error message is from this part of the metamodel regression code, where it's trying to do multitarget Gaussian regression first: https://github.com/VolpeUSDOT/RDR-Public/blob/7144ec3a0ae53cc5caf082fe358f33be982517d4/metamodel_py/rdr_Metamodel_Regression.Rmd#L199

The Quick Start 1 has only a few samples, and the sampling method can occasionally result in combinations where multitarget regression isn't possible. It should be defaulting to the base method of linear regression in that case, so we'll have to see why that's not happening!

Two things to try, if you have time:

  1. Delete the generated_files folder and try running QS1 again.
  2. Do the same, but now change the metamodel regression type to 'base' in the config file here
rhaefer commented 1 month ago

Changing the metamodel regression type to 'base' fixed the issue. Thanks Dan!

dflynn-volpe commented 1 month ago

Great that it runs, we will take on fixing this issue, appreciate you testing it out! Will keep this issue open.

jdrake-volpe commented 3 weeks ago

@rhaefer The RDR team is working on reproducing the error you identified so that we can write a fix. Would you have time to walk us through the steps of how this bug occurred? Either asynchronously or over a screenshare, whatever works for you! And of course no worries if you aren't able to assist us with this. Thank you!

jdrake-volpe commented 10 hours ago

@rhaefer Hello Reid, please let us know if you've encountered this issue again. We have not been able to reproduce it in our testing. The code should automatically change the run type to 'base' when it encounters an issue with 'multitarget'. If not, we can close the issue. Thanks!