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

Detailed Description

The class RealFileFeatures implements a dense double-precision floating point matrix from a file.

It inherits its functionality from CSimpleFeatures, which should be consulted for further reference.

Definition at line 25 of file RealFileFeatures.h.

Inheritance diagram for CRealFileFeatures:
Inheritance graph
[legend]

Public Member Functions

 CRealFileFeatures ()
 
 CRealFileFeatures (int32_t size, FILE *file)
 
 CRealFileFeatures (int32_t size, char *filename)
 
 CRealFileFeatures (const CRealFileFeatures &orig)
 
virtual ~CRealFileFeatures ()
 
virtual float64_tload_feature_matrix ()
 
int32_t get_label (int32_t idx)
 
virtual const char * get_name () const
 
- Public Member Functions inherited from CSimpleFeatures< float64_t >
 CSimpleFeatures (int32_t size=0)
 
 CSimpleFeatures (const CSimpleFeatures &orig)
 
 CSimpleFeatures (SGMatrix< float64_t > matrix)
 
 CSimpleFeatures (float64_t *src, int32_t num_feat, int32_t num_vec)
 
 CSimpleFeatures (CFile *loader)
 
virtual CFeaturesduplicate () const
 
virtual ~CSimpleFeatures ()
 
void free_feature_matrix ()
 
void free_features ()
 
float64_tget_feature_vector (int32_t num, int32_t &len, bool &dofree)
 
SGVector< float64_tget_feature_vector (int32_t num)
 
void set_feature_vector (SGVector< float64_t > vector, int32_t num)
 
void free_feature_vector (float64_t *feat_vec, int32_t num, bool dofree)
 
void free_feature_vector (SGVector< float64_t > vec, int32_t num)
 
void vector_subset (int32_t *idx, int32_t idx_len)
 
void feature_subset (int32_t *idx, int32_t idx_len)
 
void get_feature_matrix (float64_t **dst, int32_t *num_feat, int32_t *num_vec)
 
SGMatrix< float64_tget_feature_matrix ()
 
float64_tget_feature_matrix (int32_t &num_feat, int32_t &num_vec)
 
SGMatrix< float64_tsteal_feature_matrix ()
 
void set_feature_matrix (SGMatrix< float64_t > matrix)
 
virtual void set_feature_matrix (float64_t *fm, int32_t num_feat, int32_t num_vec)
 
CSimpleFeatures< float64_t > * get_transposed ()
 
float64_tget_transposed (int32_t &num_feat, int32_t &num_vec)
 
virtual void copy_feature_matrix (SGMatrix< float64_t > src)
 
void obtain_from_dot (CDotFeatures *df)
 
virtual bool apply_preprocessor (bool force_preprocessing=false)
 
virtual int32_t get_size ()
 
virtual int32_t get_num_vectors () const
 
int32_t get_num_features ()
 
void set_num_features (int32_t num)
 
void set_num_vectors (int32_t num)
 
void initialize_cache ()
 
virtual EFeatureClass get_feature_class ()
 
virtual EFeatureType get_feature_type ()
 
virtual bool reshape (int32_t p_num_features, int32_t p_num_vectors)
 
virtual int32_t get_dim_feature_space () const
 
virtual float64_t dot (int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
 
virtual float64_t dense_dot (int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
 
virtual void add_to_dense_vec (float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)
 
virtual int32_t get_nnz_features_for_vector (int32_t num)
 
virtual bool Align_char_features (CStringFeatures< char > *cf, CStringFeatures< char > *Ref, float64_t gapCost)
 
virtual void load (CFile *loader)
 
virtual void save (CFile *saver)
 
virtual void * get_feature_iterator (int32_t vector_index)
 
virtual bool get_next_feature (int32_t &index, float64_t &value, void *iterator)
 
virtual void free_feature_iterator (void *iterator)
 
virtual CFeaturescopy_subset (SGVector< index_t > indices)
 
- Public Member Functions inherited from CDotFeatures
 CDotFeatures (int32_t size=0)
 
 CDotFeatures (const CDotFeatures &orig)
 
 CDotFeatures (CFile *loader)
 
virtual ~CDotFeatures ()
 
virtual void dense_dot_range (float64_t *output, int32_t start, int32_t stop, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
 
virtual void dense_dot_range_subset (int32_t *sub_index, int32_t num, float64_t *output, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
 
float64_t get_combined_feature_weight ()
 
void set_combined_feature_weight (float64_t nw)
 
SGMatrix< float64_tget_computed_dot_feature_matrix ()
 
SGVector< float64_tget_computed_dot_feature_vector (int32_t num)
 
void benchmark_add_to_dense_vector (int32_t repeats=5)
 
void benchmark_dense_dot_range (int32_t repeats=5)
 
virtual SGVector< float64_tget_mean ()
 
virtual SGMatrix< float64_tget_cov ()
 
- Public Member Functions inherited from CFeatures
 CFeatures (int32_t size=0)
 
 CFeatures (const CFeatures &orig)
 
 CFeatures (CFile *loader)
 
virtual ~CFeatures ()
 
virtual int32_t add_preprocessor (CPreprocessor *p)
 set preprocessor More...
 
virtual CPreprocessordel_preprocessor (int32_t num)
 del current preprocessor More...
 
CPreprocessorget_preprocessor (int32_t num)
 get current preprocessor More...
 
void set_preprocessed (int32_t num)
 
bool is_preprocessed (int32_t num)
 
int32_t get_num_preprocessed ()
 get whether specified preprocessor (or all if num=1) was/were already applied More...
 
int32_t get_num_preprocessors () const
 
void clean_preprocessors ()
 clears all preprocs More...
 
int32_t get_cache_size ()
 
void list_feature_obj ()
 
bool check_feature_compatibility (CFeatures *f)
 
bool has_property (EFeatureProperty p)
 
void set_property (EFeatureProperty p)
 
void unset_property (EFeatureProperty p)
 
virtual void set_subset (CSubset *subset)
 
virtual void remove_subset ()
 
virtual void subset_changed_post ()
 
index_t subset_idx_conversion (index_t idx) const
 
bool has_subset () 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)
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 

Protected Member Functions

virtual float64_tcompute_feature_vector (int32_t num, int32_t &len, float64_t *target=NULL)
 
bool load_base_data ()
 
- Protected Member Functions inherited from CDotFeatures
void display_progress (int32_t start, int32_t stop, int32_t v)
 
- 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)
 

Protected Attributes

FILE * working_file
 
char * working_filename
 
bool status
 
int32_t * labels
 
uint8_t intlen
 
uint8_t doublelen
 
uint32_t endian
 
uint32_t fourcc
 
uint32_t preprocd
 
int64_t filepos
 
- Protected Attributes inherited from CSimpleFeatures< float64_t >
int32_t num_vectors
 number of vectors in cache More...
 
int32_t num_features
 number of features in cache More...
 
float64_tfeature_matrix
 
int32_t feature_matrix_num_vectors
 
int32_t feature_matrix_num_features
 
CCache< float64_t > * feature_cache
 
- Protected Attributes inherited from CDotFeatures
float64_t combined_weight
 feature weighting in combined dot features More...
 
- Protected Attributes inherited from CFeatures
CSubsetm_subset
 

Additional Inherited Members

- Static Public Member Functions inherited from CDotFeatures
static void * dense_dot_range_helper (void *p)
 
- Public Attributes inherited from CSGObject
SGIOio
 
Parallelparallel
 
Versionversion
 
Parameterm_parameters
 
Parameterm_model_selection_parameters
 

Constructor & Destructor Documentation

default constructor

Definition at line 20 of file RealFileFeatures.cpp.

CRealFileFeatures ( int32_t  size,
FILE *  file 
)

constructor

Parameters
sizecache size
filefile to load features from

Definition at line 50 of file RealFileFeatures.cpp.

CRealFileFeatures ( int32_t  size,
char *  filename 
)

constructor

Parameters
sizecache size
filenamefilename to load features from

Definition at line 35 of file RealFileFeatures.cpp.

copy constructor

Definition at line 70 of file RealFileFeatures.cpp.

~CRealFileFeatures ( )
virtual

Definition at line 63 of file RealFileFeatures.cpp.

Member Function Documentation

float64_t * compute_feature_vector ( int32_t  num,
int32_t &  len,
float64_t target = NULL 
)
protectedvirtual

compute feature vector for sample num len is returned by reference

Parameters
numnum
lenlen
targettarget

Reimplemented from CSimpleFeatures< float64_t >.

Definition at line 82 of file RealFileFeatures.cpp.

int32_t get_label ( int32_t  idx)

get label at given index

Parameters
idxindex to look at
Returns
label at given index

Definition at line 122 of file RealFileFeatures.cpp.

virtual const char* get_name ( ) const
virtual
Returns
object name

Reimplemented from CSimpleFeatures< float64_t >.

Definition at line 64 of file RealFileFeatures.h.

bool load_base_data ( )
protected

load base data

Returns
if loading was successful

Definition at line 130 of file RealFileFeatures.cpp.

float64_t * load_feature_matrix ( )
virtual

load feature matrix

Returns
loaded feature matrix

Definition at line 96 of file RealFileFeatures.cpp.

Member Data Documentation

uint8_t doublelen
protected

doublelen

Definition at line 96 of file RealFileFeatures.h.

uint32_t endian
protected

endian

Definition at line 98 of file RealFileFeatures.h.

int64_t filepos
protected

filepos

Definition at line 104 of file RealFileFeatures.h.

uint32_t fourcc
protected

fourcc

Definition at line 100 of file RealFileFeatures.h.

uint8_t intlen
protected

intlen

Definition at line 94 of file RealFileFeatures.h.

int32_t* labels
protected

labels

Definition at line 91 of file RealFileFeatures.h.

uint32_t preprocd
protected

preprocd

Definition at line 102 of file RealFileFeatures.h.

bool status
protected

status

Definition at line 89 of file RealFileFeatures.h.

FILE* working_file
protected

working file

Definition at line 85 of file RealFileFeatures.h.

char* working_filename
protected

working filename

Definition at line 87 of file RealFileFeatures.h.


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

SHOGUN Machine Learning Toolbox - Documentation