ctmm-initiative / ctmmweb

Web app for analyzing animal tracking data, built upon ctmm R package
http://biology.umd.edu/movement.html
GNU General Public License v3.0
30 stars 21 forks source link

More information for modeling progress #112

Closed xhdong-umd closed 3 years ago

xhdong-umd commented 4 years ago

The model fitting stage can be time consuming, we can reveal more information to make it more predictable and give better expectations to users.

  1. When there is only one individual to fit, the app will use parallel with trace on, which show detailed progress in R console. It'll be better if we can show them in the app. This may need an additional parameter in ctmm::ctmm.select:
    • the parameter is a function with two parameters, value in 0-1 for percentage, detail for message. I assume some value can be assigned to each trace message? It don't have to be accurate.
    • the default value just print the message in console, so there is no behavior or usage change needed in all ctmm code.
    • ctmmweb app will create a different updateProgress function with same interface, but update the progress in the app. @chfleming How do you think about this?
      
      updateProgress_console <- function(value = NULL, detail = NULL) {
            # may also include the value if possible
             message(detail)
      }
      ctmm.select <- function(....  updateProgress = updateProgress_console)


2. We can also pop up a warning dialog in variogram page if too many individuals are selected.
    What condition should we use?
    - just check individuals > 6?
    - also check data size?
chfleming commented 4 years ago

I'm at the end of of re-writing the optimizer's line-search algorithm, and right after that I will implement a custom message() function argument. I'm a little swamped with a job application and a job interview this week, so it might take me a few days.

chfleming commented 4 years ago

This should work now if you include a message function argument in the control list argument, control$message, then it should replace the default message function in ctmm.select, ctmm.fit, and the optimizer.

xhdong-umd commented 4 years ago

Is it possible to give some rough progress value in the internal message call in ctmm.select? If I only have message but no progress values, the progress bar will change text but not changing progress value, which may look weird.

chfleming commented 4 years ago

What I can provide, with substantial work, is information that could be put into a summary like:

Individual 2/9, fitting model 3, stage 1/4, =======55%

With the second part "fitting model", there's no way to know a priori how many models will be considered.

With the last part, I can only give a non-monotonic progress report on the parameter estimation stages (the first of which is the slowest stage) and not the Hessian stage (which is also relatively slow).

xhdong-umd commented 4 years ago

It looks to be too much work for little gain(only apply to single individual, which is less likely in app)...