# gelnet.logreg.obj: Logistic regression objective function value In gelnet: Generalized Elastic Nets

## Description

Evaluates the logistic regression objective function value for a given model. See 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.

## Usage

 1 2 gelnet.logreg.obj(w, b, X, y, l1, l2, d = rep(1, ncol(X)), P = diag(ncol(X)), m = rep(0, ncol(X)), balanced = FALSE) 

## 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 d p-by-1 vector of feature weights P p-by-p feature-feature penalty matrix m p-by-1 vector of translation coefficients balanced boolean specifying whether the balanced model is being evaluated

## Value

The objective function value.

gelnet