You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/latent.Rmd
+24-8Lines changed: 24 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -555,7 +555,12 @@ The message concerning `latent_ilink` can be safely ignored here (the internal d
555
555
556
556
Run `cv_varsel()`:
557
557
```{r weibull_cvvs}
558
-
doParallel::registerDoParallel(ncores)
558
+
# For running projpred's CV in parallel (see cv_varsel()'s argument `parallel`):
559
+
# Note: Parallel processing is disabled during package building to avoid issues
560
+
use_parallel <- FALSE # Set to TRUE for actual parallel processing
561
+
if (use_parallel) {
562
+
doParallel::registerDoParallel(ncores)
563
+
}
559
564
cvvs_weib <- cv_varsel(
560
565
refm_weib,
561
566
### Only for the sake of speed (not recommended in general):
@@ -564,13 +569,16 @@ cvvs_weib <- cv_varsel(
564
569
nterms_max = 11,
565
570
nclusters_pred = 20,
566
571
###
567
-
parallel = TRUE,
572
+
parallel = use_parallel,
568
573
### In interactive use, we recommend not to deactivate the verbose mode:
569
574
verbose = 0
570
575
###
571
576
)
572
-
doParallel::stopImplicitCluster()
573
-
foreach::registerDoSEQ()
577
+
# Tear down the CV parallelization setup:
578
+
if (use_parallel) {
579
+
doParallel::stopImplicitCluster()
580
+
foreach::registerDoSEQ()
581
+
}
574
582
```
575
583
In this case, we will ignore the warnings about high Pareto-$\hat{k}$ values because we chose quite rough settings (e.g., only 2 MCMC chains) in this vignette (for technical reasons).
576
584
We will also ignore the warning that SIS is used (instead of PSIS) because this is due to `nclusters_pred = 20` which we used only to speed up the building of the vignette.
@@ -688,7 +696,12 @@ The message concerning `latent_ilink` can be safely ignored here (the internal d
688
696
689
697
Run `cv_varsel()`:
690
698
```{r lognormal_cvvs}
691
-
doParallel::registerDoParallel(ncores)
699
+
# For running projpred's CV in parallel (see cv_varsel()'s argument `parallel`):
700
+
# Note: Parallel processing is disabled during package building to avoid issues
701
+
use_parallel <- FALSE # Set to TRUE for actual parallel processing
702
+
if (use_parallel) {
703
+
doParallel::registerDoParallel(ncores)
704
+
}
692
705
cvvs_lnorm <- cv_varsel(
693
706
refm_lnorm,
694
707
### Only for the sake of speed (not recommended in general):
@@ -697,13 +710,16 @@ cvvs_lnorm <- cv_varsel(
697
710
nterms_max = 11,
698
711
nclusters_pred = 20,
699
712
###
700
-
parallel = TRUE,
713
+
parallel = use_parallel,
701
714
### In interactive use, we recommend not to deactivate the verbose mode:
702
715
verbose = 0
703
716
###
704
717
)
705
-
doParallel::stopImplicitCluster()
706
-
foreach::registerDoSEQ()
718
+
# Tear down the CV parallelization setup:
719
+
if (use_parallel) {
720
+
doParallel::stopImplicitCluster()
721
+
foreach::registerDoSEQ()
722
+
}
707
723
```
708
724
In this case, we will ignore the warnings about high Pareto-$\hat{k}$ values because we chose quite rough settings (e.g., only 2 MCMC chains) in this vignette (for technical reasons).
709
725
We will also ignore the warning that SIS is used (instead of PSIS) because this is due to `nclusters_pred = 20` which we used only to speed up the building of the vignette.
0 commit comments