SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
ElasticNetPenalty Class Reference

Detailed Description

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.

Inheritance diagram for ElasticNetPenalty:
Inheritance graph
[legend]

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
 
L1Penaltym_l1_penalty
 
L2Penaltym_l2_penalty
 

Constructor & Destructor Documentation

Definition at line 57 of file ElasticNetPenalty.h.

virtual ~ElasticNetPenalty ( )
virtual

Definition at line 60 of file ElasticNetPenalty.h.

Member Function Documentation

virtual void check_ratio ( )
protectedvirtual

check l1_ratio

Definition at line 163 of file ElasticNetPenalty.h.

virtual float64_t get_penalty ( float64_t  variable)
virtual

Given the value of a target variable, this method returns the penalty of the variable

Parameters
variablevalue of the variable
Returns
penalty of the variable

Implements Penalty.

Definition at line 82 of file ElasticNetPenalty.h.

virtual float64_t get_penalty_gradient ( float64_t  variable,
float64_t  gradient_of_variable 
)
virtual

Return the gradient of the penalty wrt a target variable

Parameters
variablevalue of a target variable
gradient_of_variableunregularized/unpenalized gradient of the variable
Returns
the gradient of the penalty wrt the variable

Implements Penalty.

Definition at line 96 of file ElasticNetPenalty.h.

virtual float64_t get_sparse_variable ( float64_t  variable,
float64_t  penalty_weight 
)
virtual

Get the sparse variable

Parameters
variablethe raw variable
penalty_weightweight of the penalty
Returns
sparse value of the variable

Implements SparsePenalty.

Definition at line 154 of file ElasticNetPenalty.h.

virtual void load_from_context ( CMinimizerContext context)
virtual

Load the given context object to restore mutable variables

Parameters
contexta context object

Implements Penalty.

Definition at line 142 of file ElasticNetPenalty.h.

virtual void set_l1_ratio ( float64_t  ratio)
virtual

set l1_ratio

Parameters
ratioratio must be in (0.0,1.0)

Definition at line 70 of file ElasticNetPenalty.h.

virtual void set_rounding_epsilon ( float64_t  epsilon)
virtual

Set the rounding epsilon for L1 penalty

Parameters
epsilonrounding epsilon

Definition at line 110 of file ElasticNetPenalty.h.

virtual void update_context ( CMinimizerContext context)
virtual

Update a context object to store mutable variables used in learning rate

Parameters
contexta context object

Implements Penalty.

Definition at line 131 of file ElasticNetPenalty.h.

virtual void update_variable_for_proximity ( SGVector< float64_t variable,
float64_t  proximal_weight 
)
virtual

Do proximal projection/operation in place

Parameters
variablethe raw variable
proximal_weightweight of the penalty

Implements ProximalPenalty.

Definition at line 119 of file ElasticNetPenalty.h.

Member Data Documentation

L1Penalty* m_l1_penalty
protected

L1Penalty

Definition at line 172 of file ElasticNetPenalty.h.

float64_t m_l1_ratio
protected

l1_ratio for L1 penalty and (1.0-l1_ratio) for L2 penalty

Definition at line 169 of file ElasticNetPenalty.h.

L2Penalty* m_l2_penalty
protected

L2Penalty

Definition at line 175 of file ElasticNetPenalty.h.


The documentation for this class was generated from the following file:

SHOGUN Machine Learning Toolbox - Documentation