Logistic regression¶
Given a sequence of vectors \(\{a_i\}_{i=0}^{n-1} \subset \mathbb{R}^m\) with binary labels \(\{\eta_i\}_{i=0}^{n-1} \subset \{0,1\}\), \(\ell_p\)-regularized logistic regression solves the problem
\[\min_{z,\nu} \frac{1}{n} \sum_{i=0}^{n-1} f(z^H a_i + \nu \eta_i) +
\lambda \| z \|_p,\]
where \(f\) is the logistic loss function,
\[f(t) = \log(1+e^{-t}).\]
Note
While sometimes functional, this implementation is still very much a work-in-progress.
C++ API¶
-
Regularization
¶ An enum which can take on the values
NO_PENALTY
,L1_PENALTY
, andL2_PENALTY
C API¶
-
ElRegularization
¶ An enum which can take on the values
EL_NO_PENALTY
,EL_L1_PENALTY
, andEL_L2_PENALTY
-
ElError
ElLogisticRegression_s
(ElConstMatrix_s G, ElConstMatrix_s q, ElMatrix_s z, float gamma, ElRegularization penalty, ElInt* numIts)¶
-
ElError
ElLogisticRegression_d
(ElConstMatrix_d G, ElConstMatrix_d q, ElMatrix_d z, double gamma, ElRegularization penalty, ElInt* numIts)¶
-
ElError
ElLogisticRegressionDist_s
(ElConstDistMatrix_s G, ElConstDistMatrix_s q, ElDistMatrix_s z, float gamma, ElRegularization penalty, ElInt* numIts)¶
-
ElError
ElLogisticRegressionDist_d
(ElConstDistMatrix_d G, ElConstDistMatrix_d q, ElDistMatrix_d z, double gamma, ElRegularization penalty, ElInt* numIts)¶