lassoEstimation: Lasso estimation

View source: R/modelEstimation.R

lassoEstimationR Documentation

Lasso estimation

Description

Function estimates coefficients based on LASSO regularization.

Usage

lassoEstimation(
  x,
  response,
  control = list(alpha = 1, s = "lambda.min", family = "gaussian", grouped = FALSE),
  ...
)

Arguments

x

An object of type DocumentTermMatrix.

response

Response variable including the given gold standard.

control

(optional) A list of parameters defining the LASSO model as follows:

  • "s"Value of the parameter lambda at which the LASSO is evaluated. Default is s="lambda.1se" which takes the calculated minimum value for \lambda and then subtracts one standard error in order to avoid overfitting. This often results in a better performance than using the minimum value itself given by lambda="lambda.min".

  • "family"Distribution for response variable. Default is family="gaussian". For non-negative counts, use family="poisson". For binary variables family="binomial". See glmnet for further details.

  • "grouped" Determines whether grouped LASSO is used (with default FALSE).

...

Additional parameters passed to function for glmnet.

Value

Result is a list with coefficients, coefficient names and the model intercept.


SentimentAnalysis documentation built on Aug. 24, 2023, 1:07 a.m.