LinearModelL1: LinearModelL1

Description Usage Arguments Value Examples

View source: R/LinearModelL1.R

Description

minimizes the following cost function: 1/n ∑i=1^n L[w^T x_i + b, y_i] + penalty * ||w||_1

Usage

1
2
3
4
5
6
7
8
LinearModelL1(
  X.scaled.mat,
  y.vec,
  penalty,
  opt.thresh,
  initial.weight.vec,
  step.size
)

Arguments

X.scaled.mat

the scaled training matrix [ n_observations : n_features ]

y.vec

the label vector for the data matrix [ n_observations : 1 ]

penalty

a positive scaler penalty term

opt.thresh

a positive scaler

initial.weight.vec

a starting weight vector, can be random numbers or 0s [ n_features : 1 ]

step.size

the incrimental step to descent with

Value

an optimal weight vector for predictings [n_features + 1 : 1] where the first entry is the intercept term

Examples

1
2
# load the default dataset
getwd()

ChaddFrasier/planetLearn documentation built on July 5, 2020, 2:32 a.m.