KWB-R / fhpredict

R Package for the Project Flusshygiene
https://kwb-r.github.io/fhpredict
MIT License
2 stars 0 forks source link

2 Different errors when calling build_model #48

Closed ff6347 closed 4 years ago

ff6347 commented 4 years ago

Not realted to #41

When calling build_model for spot 41 user 9 from the middlelayer I get the following error (with dev branch):

{"data":{},"success":[false],"message":["Error in sprintf(\"%s_spot%d\", prefix, spot_id) : \n  invalid format '%d'; use format %s for character objects\n"]}

When calling it through the interface of opencpu i get the following errors:

{
  "data": {},
  "success": [false],
  "message": ["Error : stat::step() failed for the following step numbers:\nstep = 1: Error in stats::step(object = null, scope = list(upper = full, lower = null),  : \n  AIC is -infinity for this model, so 'step' cannot proceed\n\nstep = 2: Error in stats::step(object = null, scope = list(upper = full, lower = null),  : \n  AIC is -infinity for this model, so 'step' cannot proceed\n\n"]
}

Don't know if they are related and it can wait until you are back at work @hsonne :-)

hsonne commented 4 years ago

The first error means that spot_id given to build_model() was not an integer value as expected but a string (character in R)

The second error means that no valid model could be found. Needs to be discussed with @wseis what to do (what error message to show) in this case.

ff6347 commented 4 years ago

Cool. I can confirm that if I send real values in the POT body I get the second error. Which is wired. Why does it say that there is no model found when I do a call to build_model?

hsonne commented 4 years ago

The most probable cause is a lack of data, i.e. not "no data" but not enough data points (pairs of rain and e. coli concentration) that show some sort of correlation (i.e. the higher the rain value the higher the e. coli concentration). Did you use random values?

ff6347 commented 4 years ago

Did you use random values?

No I used values from an existing bathingspot. Can you or @wseis provide data that definitely will pass?

wseis commented 4 years ago

How many data point did you use?

ff6347 commented 4 years ago

How many data point did you use?

I guess 20 or something like that. Would be good to have a dataset ready for testing that is confirmed to work.