gelnet_blr_obj: Binary logistic regression objective function

Description Usage Arguments Details Value See Also

View source: R/RcppExports.R

Description

Evaluates the logistic regression objective function value for a given model. See details.

Usage

1
2
gelnet_blr_obj(w, b, X, y, l1, l2, balanced = FALSE, d = NULL,
  P = NULL, m = NULL)

Arguments

w

p-by-1 vector of model weights

b

the model bias term

X

n-by-p matrix of n samples in p dimensions

y

n-by-1 binary response vector sampled from 0,1

l1

L1-norm penalty scaling factor λ_1

l2

L2-norm penalty scaling factor λ_2

balanced

boolean specifying whether the balanced model is being evaluated

d

p-by-1 vector of feature weights

P

p-by-p feature-feature penalty matrix

m

p-by-1 vector of translation coefficients

Details

Computes the objective function value according to

-\frac{1}{n} ∑_i y_i s_i - \log( 1 + \exp(s_i) ) + R(w)

where

s_i = w^T x_i + b

R(w) = λ_1 ∑_j d_j |w_j| + \frac{λ_2}{2} (w-m)^T P (w-m)

When balanced is TRUE, the loss average over the entire data is replaced with averaging over each class separately. The total loss is then computes as the mean over those per-class estimates.

Value

The objective function value.

See Also

gelnet


ArtemSokolov/gelnet documentation built on Sept. 13, 2019, 4:01 a.m.