LinearModelL1penalties: Linear Model with L1 regularization

Description Usage Arguments Value Examples

Description

This algorithm takes the penalty vector as input and iterate through each value in the vector using LinearModelL1

Usage

1
2
LinearModelL1penalties(X.mat, y.vec, penalty.vec = seq(0.5, 0, length.out
  = 100), step.size = 0.01)

Arguments

X.mat

unscaled training input matrix, with size n x p

y.vec

correspond training input matrix, with size n x 1

penalty.vec

a vector with descending numeric number, default as seq(0.5, 0, length.out = 100)

step.size

a scalar with numeric value, default as 0.01

Value

W.mat matrix, with the size ((feaure.size + 1) x n.step.size.length)

Examples

1
2
3
4
5
6
7
library(LinearModelL1)
data(prostate, package = "ElemStatLearn")
prostate <- list(features = as.matrix(prostate[, 1:8]), labels = prostate$lpsa, is.01 = FALSE)
data.set <- prostate
X.mat <- data.set$features
y.vec <- data.set$labels
LinearModelL1penalties(X.mat, y.vec, seq(0.4, 0.01, -0.01), 0.01)

SixianZhang/CS499-Coding-Project-4 documentation built on June 1, 2019, 4:58 a.m.