Public Member Functions | Public Attributes | Protected Attributes

CVwRegressor Class Reference


Detailed Description

Regressor used by VW.

Stores the weight vectors and loss object, and is used for calculating losses and updates.

The weight vector uses 'num_bits' number of bits, set in the environment object to store weights.

Definition at line 35 of file VwRegressor.h.

Inheritance diagram for CVwRegressor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CVwRegressor ()
 CVwRegressor (CVwEnvironment *env_to_use)
virtual ~CVwRegressor ()
float64_t get_loss (float64_t prediction, float64_t label)
float64_t get_update (float64_t prediction, float64_t label, float64_t eta_t, float64_t norm)
virtual void dump_regressor (char *reg_name, bool as_text)
virtual void load_regressor (char *file_name)
virtual const char * get_name () const
virtual void init (CVwEnvironment *env_to_use=NULL)

Public Attributes

float32_t ** weight_vectors
 Weight vectors, one array for each thread.
CLossFunctionloss
 Loss function.

Protected Attributes

CVwEnvironmentenv
 Environment.

Constructor & Destructor Documentation

CVwRegressor (  ) 

Default constructor

Definition at line 21 of file VwRegressor.cpp.

CVwRegressor ( CVwEnvironment env_to_use  ) 

Constructor taking an environment object

Parameters:
env_to_use environment

Definition at line 29 of file VwRegressor.cpp.

~CVwRegressor (  )  [virtual]

Destructor

Definition at line 37 of file VwRegressor.cpp.


Member Function Documentation

void dump_regressor ( char *  reg_name,
bool  as_text 
) [virtual]

Dump regressor in binary/text form

Parameters:
reg_name output file name
as_text whether to dump as text

Definition at line 81 of file VwRegressor.cpp.

float64_t get_loss ( float64_t  prediction,
float64_t  label 
)

Get loss for a label-prediction set

Parameters:
prediction prediction
label label
Returns:
loss

Definition at line 63 of file VwRegressor.h.

virtual const char* get_name (  )  const [virtual]

Return name of the object

Returns:
VwRegressor

Implements CSGObject.

Definition at line 103 of file VwRegressor.h.

float64_t get_update ( float64_t  prediction,
float64_t  label,
float64_t  eta_t,
float64_t  norm 
)

Get weight update for a prediction-label set

Parameters:
prediction prediction
label label
eta_t learning rate
norm scaling norm
Returns:
update

Definition at line 78 of file VwRegressor.h.

void init ( CVwEnvironment env_to_use = NULL  )  [virtual]

Initialize weight vectors

Parameters:
env_to_use environment object

Definition at line 44 of file VwRegressor.cpp.

void load_regressor ( char *  file_name  )  [virtual]

Load the regressor from a file

Parameters:
file_name name of dumped regressor binary file

Definition at line 168 of file VwRegressor.cpp.


Member Data Documentation

CVwEnvironment* env [protected]

Environment.

Definition at line 120 of file VwRegressor.h.

Loss function.

Definition at line 116 of file VwRegressor.h.

Weight vectors, one array for each thread.

Definition at line 114 of file VwRegressor.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation