SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | 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]

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 Member Functions inherited from CSGObject
 CSGObject ()
 CSGObject (const CSGObject &orig)
virtual ~CSGObject ()
virtual bool is_generic (EPrimitiveType *generic) const
template<class T >
void set_generic ()
void unset_generic ()
virtual void print_serializable (const char *prefix="")
virtual bool save_serializable (CSerializableFile *file, const char *prefix="")
virtual bool load_serializable (CSerializableFile *file, const char *prefix="")
void set_global_io (SGIO *io)
SGIOget_global_io ()
void set_global_parallel (Parallel *parallel)
Parallelget_global_parallel ()
void set_global_version (Version *version)
Versionget_global_version ()
SGVector< char * > get_modelsel_names ()
char * get_modsel_param_descr (const char *param_name)
index_t get_modsel_param_index (const char *param_name)

Public Attributes

float32_t ** weight_vectors
 Weight vectors, one array for each thread.
CLossFunctionloss
 Loss function.
- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters

Protected Attributes

CVwEnvironmentenv
 Environment.

Additional Inherited Members

- Protected Member Functions inherited from CSGObject
virtual void load_serializable_pre () throw (ShogunException)
virtual void load_serializable_post () throw (ShogunException)
virtual void save_serializable_pre () throw (ShogunException)
virtual void save_serializable_post () throw (ShogunException)

Constructor & Destructor Documentation

Default constructor

Definition at line 21 of file VwRegressor.cpp.

CVwRegressor ( CVwEnvironment env_to_use)

Constructor taking an environment object

Parameters
env_to_useenvironment

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_nameoutput file name
as_textwhether 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
predictionprediction
labellabel
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
predictionprediction
labellabel
eta_tlearning rate
normscaling 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_useenvironment object

Definition at line 44 of file VwRegressor.cpp.

void load_regressor ( char *  file_name)
virtual

Load the regressor from a file

Parameters
file_namename 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.

float32_t** weight_vectors

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:

SHOGUN Machine Learning Toolbox - Documentation