lasso_multi_back: Lasso regression with backtraking line research for...

View source: R/models.R

lasso_multi_backR Documentation

Lasso regression with backtraking line research for multinomial response variable

Description

the function carries out the Lasso regression for multinomial response using backtraking line research and FISTA/ISTA algorithm.

Usage

lasso_multi_back(data,y,x,lambda,max_step=10000,image=FALSE,fista=TRUE,tol=10^-7,ini=0)

Arguments

data

name of the dataset

y

name of the dependent variables

x

name of the independent variable

lambda

a vector of lambda-value to be evaluated in the regression

max_step

maximum number of steps

image

plots the evolution of errors in term of lambda values

fista

fista=TRUE: use FISTA algortihm for the multiclass logistic regression; fista=FALSE: use ISTA algortihm

tol

tolerance for the convergence

ini

initial value for the coefficients, default is 0 #'@examples library(glmnet) data("MultinomialExample") x<-MultinomialExample$x y<-MultinomialExample$y mult<-as.data.frame(cbind(x,y)) lasso_multi_back(mult,y="y",x=colnames(mult)[-31],max_step = 1000,lambda=0.01,image=TRUE,fista=TRUE,ini=0)

Details

lasso_multi_back

Value

A list containing:

  • coefficients: A matrix where each column represents the estimated regression coefficients for a different lambda value.

  • error_evolution: A numeric vector tracking the error at certain step.

  • num_steps: An integer vector indicating the number of steps in which errors are calculated.


ProxReg documentation built on April 3, 2025, 9:21 p.m.