LMLogisticLossIterations: Linear model iteration with logistic loss

Description Usage Arguments Value Examples

Description

Training by using gradient descent on a linear model with logistic loss . Return a matrix of weight vector for each iteration to the max iteration.

Usage

1
LMLogisticLossIterations(X.mat, y.vec, max.iterations, step.size)

Arguments

X.mat

train feature matrix of size [n x p]

y.vec

train label vector of size [n x 1]

max.iterations

integer scalar greater than 1

step.size

a numeric scalar greater than zero

Value

W.mat matrix of weight vectors of size [(p + 1) x max.iterations]

Examples

1
2
3
4
5
data(spam, package = "ElemStatLearn")
X.mat <- as.matrix(spam[, 1:57])
y.vec <- ifelse(spam$spam == "spam", 1, -1)
W.mat <- LMLogisticLossIterations(X.mat, y.vec, max.iterations = 100L, step.size = 0.5)
(W.mat)

SixianZhang/CS499-Coding-Project-2 documentation built on May 26, 2019, 3:31 p.m.