Class CStreamingFileFromSparseFeatures is derived from CStreamingFile and provides an input source for the online framework. It uses an existing CSparseFeatures object to generate online examples.
Definition at line 22 of file StreamingFileFromSparseFeatures.h.
Public Member Functions | |
CStreamingFileFromSparseFeatures () | |
CStreamingFileFromSparseFeatures (CSparseFeatures< T > *feat) | |
CStreamingFileFromSparseFeatures (CSparseFeatures< T > *feat, float64_t *lab) | |
virtual | ~CStreamingFileFromSparseFeatures () |
virtual void | get_sparse_vector (SGSparseVectorEntry< T > *&vec, int32_t &len) |
virtual void | get_sparse_vector_and_label (SGSparseVectorEntry< T > *&vec, int32_t &len, float64_t &label) |
void | reset_stream () |
virtual const char * | get_name () const |
Protected Attributes | |
CSparseFeatures< T > * | features |
SparseFeatures object. | |
int32_t | vector_num |
Index of vector to be returned from the feature matrix. |
Default constructor
Definition at line 104 of file StreamingFileFromSparseFeatures.h.
CStreamingFileFromSparseFeatures | ( | CSparseFeatures< T > * | feat | ) |
Constructor taking a SparseFeatures object as arg
feat | SparseFeatures object |
Definition at line 111 of file StreamingFileFromSparseFeatures.h.
CStreamingFileFromSparseFeatures | ( | CSparseFeatures< T > * | feat, | |
float64_t * | lab | |||
) |
Constructor taking a SparseFeatures object as arg
feat | SparseFeatures object | |
lab | Labels as float64_t* |
Definition at line 118 of file StreamingFileFromSparseFeatures.h.
~CStreamingFileFromSparseFeatures | ( | ) | [virtual] |
Destructor
Definition at line 125 of file StreamingFileFromSparseFeatures.h.
virtual const char* get_name | ( | void | ) | const [virtual] |
Reimplemented from CStreamingFileFromFeatures.
Definition at line 82 of file StreamingFileFromSparseFeatures.h.
void get_sparse_vector | ( | SGSparseVectorEntry< T > *& | vec, | |
int32_t & | len | |||
) | [virtual] |
This function will be called for reading vectors from the corresponding SparseFeatures object. It is specialized depending on class type T.
vec | vector | |
len | length of vector |
Definition at line 138 of file StreamingFileFromSparseFeatures.h.
void get_sparse_vector_and_label | ( | SGSparseVectorEntry< T > *& | vec, | |
int32_t & | len, | |||
float64_t & | label | |||
) | [virtual] |
This function will be called for reading vectors and labels from the corresponding SparseFeatures object. It is specialized depending on class type T.
vec | vector | |
len | length of vector | |
label | label |
Definition at line 160 of file StreamingFileFromSparseFeatures.h.
void reset_stream | ( | ) | [virtual] |
Reset the stream so the next example returned is the first example in the SparseFeatures object.
Reimplemented from CStreamingFile.
Definition at line 76 of file StreamingFileFromSparseFeatures.h.
CSparseFeatures<T>* features [protected] |
SparseFeatures object.
Reimplemented from CStreamingFileFromFeatures.
Definition at line 96 of file StreamingFileFromSparseFeatures.h.
int32_t vector_num [protected] |
Index of vector to be returned from the feature matrix.
Definition at line 99 of file StreamingFileFromSparseFeatures.h.