SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
CVwCacheReader Class Reference

Detailed Description

Base class from which all cache readers for VW should be derived.

The object is given cache file information and the environment which will be used during parsing, and must implement a read_cached_example() function which returns a parsed example by reference.

Definition at line 43 of file VwCacheReader.h.

Inheritance diagram for CVwCacheReader:
Inheritance graph
[legend]

Public Member Functions

 CVwCacheReader ()
 CVwCacheReader (char *fname, CVwEnvironment *env_to_use)
 CVwCacheReader (int32_t f, CVwEnvironment *env_to_use)
virtual ~CVwCacheReader ()
virtual void set_file (int32_t f)
virtual void set_env (CVwEnvironment *env_to_use)
virtual CVwEnvironmentget_env ()
virtual void set_mm (float64_t label)
virtual void noop_mm (float64_t label)
virtual void set_minmax (float64_t label)
virtual bool read_cached_example (VwExample *const ae)=0
virtual const char * get_name () const
- 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)

Protected Attributes

int32_t fd
 File descriptor.
CVwEnvironmentenv
 Environment.

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters
- 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 20 of file VwCacheReader.cpp.

CVwCacheReader ( char *  fname,
CVwEnvironment env_to_use 
)

Constructor, opens file specified by filename

Parameters
fnamename of file to open
env_to_useEnvironment to use

Definition at line 27 of file VwCacheReader.cpp.

CVwCacheReader ( int32_t  f,
CVwEnvironment env_to_use 
)

Constructor which takes an already opened file descriptor as argument.

Parameters
ffile descriptor
env_to_useVwEnvironment object to use

Definition at line 39 of file VwCacheReader.cpp.

~CVwCacheReader ( )
virtual

Destructor

Definition at line 47 of file VwCacheReader.cpp.

Member Function Documentation

CVwEnvironment * get_env ( )
virtual

Get the environment

Returns
environment

Definition at line 66 of file VwCacheReader.cpp.

virtual const char* get_name ( ) const
virtual

Return the name of the object

Returns
VwCacheReader

Implements CSGObject.

Reimplemented in CVwNativeCacheReader.

Definition at line 137 of file VwCacheReader.h.

virtual void noop_mm ( float64_t  label)
virtual

A dummy function performing no operation in case training is not to be performed.

Parameters
labellabel

Definition at line 112 of file VwCacheReader.h.

virtual bool read_cached_example ( VwExample *const  ae)
pure virtual

Function to read one example from the cache

Returns
read example

Implemented in CVwNativeCacheReader.

void set_env ( CVwEnvironment env_to_use)
virtual

Set the environment

Parameters
env_to_useenvironment

Definition at line 60 of file VwCacheReader.cpp.

void set_file ( int32_t  f)
virtual

Set the file descriptor to use

Parameters
fdescriptor of cache file

Reimplemented in CVwNativeCacheReader.

Definition at line 55 of file VwCacheReader.cpp.

virtual void set_minmax ( float64_t  label)
virtual

Function which is actually called to update min and max labels Should be set to one of the functions implemented for this.

Parameters
labellabel based on which to update

Definition at line 120 of file VwCacheReader.h.

virtual void set_mm ( float64_t  label)
virtual

Update min and max labels seen in the environment

Parameters
labelcurrent label based on which to update

Definition at line 99 of file VwCacheReader.h.

Member Data Documentation

CVwEnvironment* env
protected

Environment.

Definition at line 144 of file VwCacheReader.h.

int32_t fd
protected

File descriptor.

Definition at line 141 of file VwCacheReader.h.


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

SHOGUN Machine Learning Toolbox - Documentation