get_beta_glmnet: Run CV glmnet

Description Usage Arguments Value

View source: R/linear_crt.r

Description

Returns the fitted coefficients from a lasso fit after tuning the regularization parameter by cross-validation. Intended for internal use with the linear_crt function.

Usage

1
2
get_beta_glmnet(X, Y, train_idx, family = "gaussian", s = "lambda.min",
  parallel = FALSE)

Arguments

X

and n by p matrix

Y

a response vector of length n

train_idx

a set of indices to train on

family

type of regression, either "gaussian" or "binomial"

s

coefficient vector to return. either "lambda.min" or "lambda.1se"

parallel

set to TRUE to run CV in parallel. Must initialize DoMC or DoParallel prior to execution.

Value

Fitted coefficients, a vector of length p + 1. First coordinate is the intercept.


stephenbates19/digitaltwins documentation built on Feb. 25, 2020, 12:41 a.m.