simon-smart88 / disagapp

R shiny app for disaggregation regression
https://simon-smart88.github.io/disagapp/
0 stars 0 forks source link

Reduce/remove data duplication #19

Closed simon-smart88 closed 6 months ago

simon-smart88 commented 8 months ago

@timcdlucas - not sure if this should be here or for {disaggregation} but in the current version, we end up with the data being duplicated multiple times and using the low resolution example covariates (100kb in total) ends up creating a 40Mb .rds by the end of the analysis which seems very inefficient and will cause us issues further down the line with larger rasters. These are the current locations where covariate rasters end up:

I will set common$covs_prep to NULL after disaggregation::prepare_data is completed but I don't understand whether we need common$fit$data or if that can be set to NULL too? That seems to be a complete duplication of common$prep and even if that's used by disaggregation::predict_model it would seem more efficient to just include the prepared data as an argument to that function.

There is also common$pred$covariates$sum created by disaggregation::predict_model which is a single layer raster and I don't know what that represents.

simon-smart88 commented 8 months ago

Looking more, common$fit$data is used by plot.disag_model but if we want to put the same plot in here, we could just copy that code across and use the prepared data instead.

simon-smart88 commented 6 months ago

Closing this for now - a lot of the duplication was actually of the response data and this has been partially addressed by resp_simplify