X-Git-Url: https://git.auder.net/?p=valse.git;a=blobdiff_plain;f=pkg%2FR%2Fmain.R;h=8f845f428f434f39699c40f8cb430ee34129ae6e;hp=ab25daf5fa210933b5516a0fa875e06b935f2808;hb=19041906b8d80eb9a7dac7bffebf3992bcec6ccf;hpb=0eb161e3f3d018bce7d98fc85622d14910f89d43 diff --git a/pkg/R/main.R b/pkg/R/main.R index ab25daf..8f845f4 100644 --- a/pkg/R/main.R +++ b/pkg/R/main.R @@ -87,11 +87,13 @@ valse = function(X, Y, procedure='LassoMLE', selecMod='DDSE', gamma=1, mini=10, # List (index k) of lists (index lambda) of models models_list <- - if (ncores_k > 1) + #if (ncores_k > 1) + if (ncores_outer > 1) parLapply(cl, kmin:kmax, computeModels) else lapply(kmin:kmax, computeModels) - if (ncores_k > 1) + #if (ncores_k > 1) + if (ncores_outer > 1) parallel::stopCluster(cl) if (! requireNamespace("capushe", quietly=TRUE)) @@ -102,11 +104,11 @@ valse = function(X, Y, procedure='LassoMLE', selecMod='DDSE', gamma=1, mini=10, # Get summary "tableauRecap" from models ; TODO: jusqu'à ligne 114 à mon avis là c'est faux :/ tableauRecap = t( sapply( models_list, function(models) { - llh = do.call(rbind, lapply(models, function(model) model$llh) + llh = do.call(rbind, lapply(models, function(model) model$llh)) LLH = llh[-1,1] D = llh[-1,2] c(LLH, D, rep(k, length(model)), 1:length(model)) - ) } ) ) + } )) if (verbose) print('Model selection') tableauRecap = tableauRecap[rowSums(tableauRecap[, 2:4])!=0,]