copt.utils.LogLoss

class copt.utils.LogLoss(A, b, alpha=0.0)[source]

Logistic loss function.

The logistic loss function is defined as

\[-\frac{1}{n}\sum_{i=1}^n b_i \log(\sigma(\bs{a}_i^T \bs{x})) + (1 - b_i) \log(1 - \sigma(\bs{a}_i^T \bs{x}))\]

where \(\sigma\) is the sigmoid function \(\sigma(t) = 1/(1 + e^{-t})\).

The input vector b verifies \(0 \leq b_i \leq 1\). When it comes from class labels, it should have the values 0 or 1.

References

http://fa.bianp.net/drafts/derivatives_logistic.html

__init__(A, b, alpha=0.0)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

Hessian(x)

Return a callable that performs dot products with the Hessian.

__init__(A, b[, alpha])

Initialize self.

f_grad(x[, return_gradient])

Attributes

lipschitz

max_lipschitz

partial_deriv

Hessian(x)[source]

Return a callable that performs dot products with the Hessian.