setup.lincoef: Set lincoef parameters

View source: R/setup.R

setup.lincoefR Documentation

Set lincoef parameters

Description

Set lincoef parameters

Usage

setup.lincoef(
  method = c("glmnet", "cv.glmnet", "lm.ridge", "allSubsets", "forwardStepwise",
    "backwardStepwise", "glm", "sgd", "solve"),
  alpha = 0,
  lambda = 0.01,
  lambda.seq = NULL,
  cv.glmnet.nfolds = 5,
  which.cv.glmnet.lambda = c("lambda.min", "lambda.1se"),
  nbest = 1,
  nvmax = 8,
  sgd.model = "glm",
  sgd.model.control = list(lambda1 = 0, lambda2 = 0),
  sgd.control = list(method = "ai-sgd")
)

Arguments

method

Character: Method to use:

  • "glm": uses stats::lm.wfit

  • "glmnet": uses glmnet::glmnet

  • "cv.glmnet": uses glmnet:cv.glmnet

  • "lm.ridge": uses MASS::lm.ridge

  • "allsubsets": uses leaps::regsubsets with method = "exhaustive"

  • "forwardStepwise": uses leaps::regsubsets with method = "forward"

  • "backwardStepwise": uses leaps::regsubsets with method = "backward"

  • "sgd": uses sgd::sgd

  • "solve": uses base::solve

  • "none": fits no model and returns all zeroes, for programming convenience in special cases

alpha

Float: alpha for method = glmnet or cv.glmnet.

lambda

Float: The lambda value for glmnet, cv.glmnet, lm.ridge Note: For glmnet and cv.glmnet, this is the lambda used for prediction. Training uses lambda.seq.

lambda.seq

Float, vector: lambda sequence for glmnet and cv.glmnet.

cv.glmnet.nfolds

Integer: Number of folds for cv.glmnet

which.cv.glmnet.lambda

Character: Whitch lambda to pick from cv.glmnet: "lambda.min": Lambda that gives minimum cross-validated error;

nbest

Integer: For method = "allSubsets", number of subsets of each size to record. Default = 1

nvmax

Integer: For method = "allSubsets", maximum number of subsets to examine.

sgd.model

Character: Model to use for method = "sgd".

sgd.model.control

List: model.control list to pass to sgd::sgd

sgd.control

List: sgd.control list to pass to sgd::sgd "lambda.1se": Largest lambda such that error is within 1 s.e. of the minimum.


egenn/rtemis documentation built on May 4, 2024, 7:40 p.m.