13 #ifndef _SIMPLEFEATURES__H__
14 #define _SIMPLEFEATURES__H__
24 template<
class ST>
class CStringFeatures;
25 template<
class ST>
class CSimpleFeatures;
360 virtual bool reshape(int32_t p_num_features, int32_t p_num_vectors);
405 float64_t* vec2, int32_t vec2_len,
bool abs_val =
false);
436 #ifndef DOXYGEN_SHOULD_SKIP_THIS
438 struct simple_feature_iterator
500 inline virtual const char*
get_name()
const {
return "SimpleFeatures"; }
543 #endif // _SIMPLEFEATURES__H__
virtual void load(CFile *loader)
virtual ST * compute_feature_vector(int32_t num, int32_t &len, ST *target=NULL)
virtual bool apply_preprocessor(bool force_preprocessing=false)
virtual void free_feature_iterator(void *iterator)
void feature_subset(int32_t *idx, int32_t idx_len)
virtual void copy_feature_matrix(SGMatrix< ST > src)
SGMatrix< ST > steal_feature_matrix()
CCache< ST > * feature_cache
virtual void * get_feature_iterator(int32_t vector_index)
ST * get_feature_vector(int32_t num, int32_t &len, bool &dofree)
virtual int32_t get_num_vectors() const
virtual bool reshape(int32_t p_num_features, int32_t p_num_vectors)
int32_t num_vectors
number of vectors in cache
virtual int32_t get_nnz_features_for_vector(int32_t num)
virtual int32_t get_dim_feature_space() const
virtual ~CSimpleFeatures()
int32_t feature_matrix_num_features
void free_feature_vector(ST *feat_vec, int32_t num, bool dofree)
Features that support dot products among other operations.
EFeatureClass
shogun feature class
void set_feature_matrix(SGMatrix< ST > matrix)
void set_feature_vector(SGVector< ST > vector, int32_t num)
virtual EFeatureType get_feature_type()
CSimpleFeatures(int32_t size=0)
CSimpleFeatures< ST > * get_transposed()
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
A File access base class.
EFeatureType
shogun feature type
virtual CFeatures * copy_subset(SGVector< index_t > indices)
virtual void save(CFile *saver)
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
virtual bool Align_char_features(CStringFeatures< char > *cf, CStringFeatures< char > *Ref, float64_t gapCost)
virtual const char * get_name() const
The class Features is the base class of all feature objects.
The class SimpleFeatures implements dense feature matrices.
void obtain_from_dot(CDotFeatures *df)
SGMatrix< ST > get_feature_matrix()
virtual EFeatureClass get_feature_class()
void free_feature_matrix()
void vector_subset(int32_t *idx, int32_t idx_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 CFeatures * duplicate() const
int32_t feature_matrix_num_vectors
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
int32_t get_num_features()
void set_num_vectors(int32_t num)
virtual int32_t get_size()
void set_num_features(int32_t num)
int32_t num_features
number of features in cache