15 #ifndef _DENSEFEATURES__H__ 16 #define _DENSEFEATURES__H__ 18 #include <shogun/lib/config.h> 30 template<
class ST>
class CStringFeatures;
31 template<
class ST>
class CDenseFeatures;
32 template<
class ST>
class SGMatrix;
70 template<
class ST>
class CDenseFeatures:
public CDotFeatures
336 virtual bool reshape(int32_t p_num_features, int32_t p_num_vectors);
381 float64_t* vec2, int32_t vec2_len,
bool abs_val =
false);
394 virtual void load(CFile* loader);
400 virtual void save(CFile* saver);
402 #ifndef DOXYGEN_SHOULD_SKIP_THIS 404 struct dense_feature_iterator
509 #ifndef SWIG // SWIG should skip this part 514 virtual const char*
get_name()
const {
return "DenseFeatures"; }
560 #endif // _DENSEFEATURES__H__
SGMatrix< ST > get_feature_matrix()
void set_feature_matrix(SGMatrix< ST > matrix)
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
virtual CFeatures * copy_subset(SGVector< index_t > indices)
virtual int32_t get_dim_feature_space() const
virtual EFeatureType get_feature_type() const
void set_num_vectors(int32_t num)
int32_t num_features
number of features in cache
CDotFeatures(int32_t size=0)
CDenseFeatures(int32_t size=0)
void set_feature_vector(SGVector< ST > vector, int32_t num)
void feature_subset(int32_t *idx, int32_t idx_len)
void obtain_from_dot(CDotFeatures *df)
CFeatures(int32_t size=0)
virtual void * get_feature_iterator(int32_t vector_index)
virtual bool reshape(int32_t p_num_features, int32_t p_num_vectors)
void free_feature_matrix()
virtual const char * get_name() const
virtual bool is_equal(CDenseFeatures *rhs)
EFeatureClass
shogun feature class
ST * get_feature_vector(int32_t num, int32_t &len, bool &dofree)
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
int32_t num_vectors
number of vectors in cache
SGMatrix< ST > feature_matrix
void free_feature_vector(ST *feat_vec, int32_t num, bool dofree)
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 bool apply_preprocessor(bool force_preprocessing=false)
virtual EFeatureClass get_feature_class() const
virtual CFeatures * shallow_subset_copy()
CCache< ST > * feature_cache
CDenseFeatures< ST > * get_transposed()
SGMatrix< ST > steal_feature_matrix()
EFeatureType
shogun feature type
void set_num_features(int32_t num)
int32_t get_num_features() const
virtual CFeatures * duplicate() const
virtual int32_t get_num_vectors() const
all of classes and functions are contained in the shogun namespace
static CDenseFeatures * obtain_from_generic(CFeatures *const base_features)
void vector_subset(int32_t *idx, int32_t idx_len)
virtual CFeatures * copy_dimension_subset(SGVector< index_t > dims)
virtual void save(CFile *saver)
virtual void load(CFile *loader)
virtual ~CDenseFeatures()
virtual ST * compute_feature_vector(int32_t num, int32_t &len, ST *target=NULL)
virtual int32_t get_nnz_features_for_vector(int32_t num)
CFeatures * create_merged_copy(CList *other)
void copy_feature_matrix(SGMatrix< ST > target, index_t column_offset=0) const
virtual void free_feature_iterator(void *iterator)