glmLite: Bare bones decision tree derived from 'rpart'

View source: R/glmLite.R

glmLiteR Documentation

Bare bones decision tree derived from rpart

Description

A super-stripped down decision tree for when space and performance are critical

Usage

glmLite(
  x,
  y,
  weights = NULL,
  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"),
  save.fitted = FALSE,
  ...
)

Arguments

x

Feature matrix or data.frame. Will be coerced to data.frame for method = "allSubsets", "forwardStepwise", or "backwardStepwise"

y

Outcome

weights

Float, vector: Case weights

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.

save.fitted

Logical: If TRUE, save fitted values in output. Default = FALSE

...

Additional arguments to pass to lincoef

Author(s)

E.D. Gennatas


egenn/rtemis documentation built on Dec. 17, 2024, 6:16 p.m.