projects
/
valse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update main.R and fix some errors
[valse.git]
/
pkg
/
R
/
main.R
diff --git
a/pkg/R/main.R
b/pkg/R/main.R
index
ab25daf
..
8f845f4
100644
(file)
--- 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 <-
# 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)
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))
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) {
# 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))
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,]
if (verbose)
print('Model selection')
tableauRecap = tableauRecap[rowSums(tableauRecap[, 2:4])!=0,]