SHOGUN
4.1.0
|
The is the base class for ElasticNet penalty/regularization within the FirstOrderMinimizer framework.
For ElasticNet penalty, \(ElasticNet(w)\)
\[ ElasticNet(w)= \lambda \| w \|_1 + (1.0-\lambda) \| w \|_2 \]
where \(\lambda\) is the l1_ratio.
Reference: Zou, Hui, and Trevor Hastie. "Regularization and variable selection via the elastic net." Journal of the Royal Statistical Society: Series B (Statistical Methodology) 67.2 (2005): 301-320.
Definition at line 54 of file ElasticNetPenalty.h.
Public Member Functions | |
ElasticNetPenalty () | |
virtual | ~ElasticNetPenalty () |
virtual void | set_l1_ratio (float64_t ratio) |
virtual float64_t | get_penalty (float64_t variable) |
virtual float64_t | get_penalty_gradient (float64_t variable, float64_t gradient_of_variable) |
virtual void | set_rounding_epsilon (float64_t epsilon) |
virtual void | update_variable_for_proximity (SGVector< float64_t > variable, float64_t proximal_weight) |
virtual void | update_context (CMinimizerContext *context) |
virtual void | load_from_context (CMinimizerContext *context) |
virtual float64_t | get_sparse_variable (float64_t variable, float64_t penalty_weight) |
Protected Member Functions | |
virtual void | check_ratio () |
Protected Attributes | |
float64_t | m_l1_ratio |
L1Penalty * | m_l1_penalty |
L2Penalty * | m_l2_penalty |
Definition at line 57 of file ElasticNetPenalty.h.
|
virtual |
Definition at line 60 of file ElasticNetPenalty.h.
|
protectedvirtual |
check l1_ratio
Definition at line 163 of file ElasticNetPenalty.h.
Given the value of a target variable, this method returns the penalty of the variable
variable | value of the variable |
Implements Penalty.
Definition at line 82 of file ElasticNetPenalty.h.
|
virtual |
Return the gradient of the penalty wrt a target variable
variable | value of a target variable |
gradient_of_variable | unregularized/unpenalized gradient of the variable |
Implements Penalty.
Definition at line 96 of file ElasticNetPenalty.h.
Get the sparse variable
variable | the raw variable |
penalty_weight | weight of the penalty |
Implements SparsePenalty.
Definition at line 154 of file ElasticNetPenalty.h.
|
virtual |
Load the given context object to restore mutable variables
context | a context object |
Implements Penalty.
Definition at line 142 of file ElasticNetPenalty.h.
|
virtual |
set l1_ratio
ratio | ratio must be in (0.0,1.0) |
Definition at line 70 of file ElasticNetPenalty.h.
|
virtual |
Set the rounding epsilon for L1 penalty
epsilon | rounding epsilon |
Definition at line 110 of file ElasticNetPenalty.h.
|
virtual |
Update a context object to store mutable variables used in learning rate
context | a context object |
Implements Penalty.
Definition at line 131 of file ElasticNetPenalty.h.
|
virtual |
Do proximal projection/operation in place
variable | the raw variable |
proximal_weight | weight of the penalty |
Implements ProximalPenalty.
Definition at line 119 of file ElasticNetPenalty.h.
|
protected |
Definition at line 172 of file ElasticNetPenalty.h.
|
protected |
l1_ratio for L1 penalty and (1.0-l1_ratio) for L2 penalty
Definition at line 169 of file ElasticNetPenalty.h.
|
protected |
Definition at line 175 of file ElasticNetPenalty.h.