crossval_downscaling too strict with prob categories
Hi @eduzenli (fyi @vagudets @abatalla ),
I'm testing the new extreme_probabilities option with SUNSET in the workstation with the BigPrediData branch, this recipe and script.
To be able to use the extreme_probabilites function, I added more probabilistic categories to the recipe:
Probabilities:
percentiles: [[1/3, 2/3], [1/10], [9/10]]
This is how the probabilites and categories (also defined in the script) look like:
> recipe$Analysis$Workflow$Probabilities$percentiles
$percentiles[[1]]
[1] 0.3333333 0.6666667
$percentiles[[2]]
[1] 0.1
$percentiles[[3]]
[1] 0.9
> categories
[[1]]
[1] 0.3333333 0.6666667
[[2]]
[1] 0.1
[[3]]
[1] 0.9
Then when trying to downscale the data, the module fails, probably because of these new categories that I added on the recipe. ¿Could that be the case? This is the error message I get:
> dwn_data <- Crossval_downscaling(recipe, data)
Error in do.ply(i) :
task 1 failed - "Expected 2st returned element by 'fun' to have 1 dimensions, but 0 found."
> traceback()
6: stop(simpleError(msg, call = expr))
5: e$fun(obj, substitute(ex), parent.frame(), e$data)
4: foreach::`%dopar%`(fe, do.ply(i))
3: llply(1:length(chunk_sizes), iteration, .parallel = parallel)
2: Apply(obs_tr_lim, target_dims = c("syear"), fun = function(x,
prob_lims) {
lapply(prob_lims, function(ps) {
quantile(as.vector(x), ps, na.rm = na.rm)
})
}, output_dims = lapply(categories, function(x) {
"bin"
}), prob_lims = categories, ncores = ncores) at Crossval_downscaling.R#552
1: Crossval_downscaling(recipe, data)
Could you please doublecheck the crossval_downscaling.R to open the option to include more than tercile categories?
Many thanks,
Paloma