Skip to content

Commit bec6258

Browse files
add nterms_max as argument in approximate_cv methods
1 parent 857bb53 commit bec6258

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

R/workflow.R

+8-2
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ approximate_loo.refmodel <- function(object, ...) {
230230
approximate_loo.vselsearch <- function(object,
231231
ndraws_pred = 400,
232232
nclusters_pred = NULL,
233+
nterms_max = NULL,
233234
verbose = TRUE,
234235
penalty = NULL,
235236
nloo = NULL,
@@ -238,7 +239,9 @@ approximate_loo.vselsearch <- function(object,
238239
...) {
239240
refmodel <- object$refmodel
240241
family <- refmodel$family
241-
nterms_max <- object$control$nterms_max
242+
if (is.null(nterms_max)) {
243+
nterms_max <- object$object$nterms_max
244+
}
242245

243246
## fetch the default arguments or replace them by the user defined values
244247
args <- parse_args_varsel(
@@ -445,6 +448,7 @@ approximate_kfold.refmodel <- function(object, ...) {
445448
approximate_kfold.vselsearch <- function(object,
446449
ndraws_pred = 400,
447450
nclusters_pred = NULL,
451+
nterms_max = NULL,
448452
K = NULL,
449453
verbose = TRUE,
450454
penalty = NULL,
@@ -454,7 +458,9 @@ approximate_kfold.vselsearch <- function(object,
454458
...) {
455459
refmodel <- object$refmodel
456460
family <- refmodel$family
457-
nterms_max <- object$object$nterms_max
461+
if (is.null(nterms_max)) {
462+
nterms_max <- object$object$nterms_max
463+
}
458464

459465
solution_terms <- object$solution_terms
460466
p_sel <- object$p_sel

0 commit comments

Comments
 (0)