Skip to content

Commit

Permalink
add nterms_max as argument in approximate_cv methods
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCatalina committed Sep 12, 2021
1 parent 857bb53 commit bec6258
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/workflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ approximate_loo.refmodel <- function(object, ...) {
approximate_loo.vselsearch <- function(object,
ndraws_pred = 400,
nclusters_pred = NULL,
nterms_max = NULL,
verbose = TRUE,
penalty = NULL,
nloo = NULL,
Expand All @@ -238,7 +239,9 @@ approximate_loo.vselsearch <- function(object,
...) {
refmodel <- object$refmodel
family <- refmodel$family
nterms_max <- object$control$nterms_max
if (is.null(nterms_max)) {
nterms_max <- object$object$nterms_max
}

## fetch the default arguments or replace them by the user defined values
args <- parse_args_varsel(
Expand Down Expand Up @@ -445,6 +448,7 @@ approximate_kfold.refmodel <- function(object, ...) {
approximate_kfold.vselsearch <- function(object,
ndraws_pred = 400,
nclusters_pred = NULL,
nterms_max = NULL,
K = NULL,
verbose = TRUE,
penalty = NULL,
Expand All @@ -454,7 +458,9 @@ approximate_kfold.vselsearch <- function(object,
...) {
refmodel <- object$refmodel
family <- refmodel$family
nterms_max <- object$object$nterms_max
if (is.null(nterms_max)) {
nterms_max <- object$object$nterms_max
}

solution_terms <- object$solution_terms
p_sel <- object$p_sel
Expand Down

0 comments on commit bec6258

Please sign in to comment.