28 init(NULL, 0, use_quadr, keep_lin_terms);
35 init(feats, d, use_quadr, keep_lin_terms);
43 init(feats, d, use_quadr, keep_lin_terms);
52 init(feats, d, use_quadr, keep_lin_terms);
103 int32_t vec_idx)
const 132 hash_cache[i] = hash;
134 if ( (!use_quadratic) || keep_linear_terms )
150 idx = (hash_cache[i] ^ hash_cache[j]) % dim;
156 int32_t num_nnz_features = 0;
165 int32_t sparse_index = 0;
213 hash_cache[i] = hash;
231 idx = (hash_cache[i] ^ hash_cache[j]) %
dim;
243 float64_t* vec2, int32_t vec2_len,
bool abs_val)
258 hash_cache[i] = hash;
276 idx = (hash_cache[i] ^ hash_cache[j]) %
dim;
312 return "HashedSparseFeatures";
virtual const char * get_name() const =0
virtual const char * get_name() const
CSparseFeatures< ST > * sparse_feats
static SGSparseVector< ST > hash_vector(SGVector< ST > vec, int32_t dim, bool use_quadratic=false, bool keep_linear_terms=true)
Template class SparseFeatures implements sparse matrices.
CHashedSparseFeatures(int32_t size=0, bool use_quadr=false, bool keep_lin_terms=true)
#define SG_NOTIMPLEMENTED
T sparse_dot(const SGSparseVector< T > &v)
virtual ~CHashedSparseFeatures()
Features that support dot products among other operations.
EFeatureClass
shogun feature class
static uint32_t MurmurHash3(uint8_t *data, int32_t len, uint32_t seed)
SGSparseVector< ST > get_hashed_feature_vector(int32_t vec_idx) const
virtual EFeatureClass get_feature_class() const
Class SGObject is the base class of all shogun objects.
virtual int32_t get_nnz_features_for_vector(int32_t num)
virtual int32_t get_dim_feature_space() const
virtual int32_t get_num_vectors() const
This class is identical to the CDenseFeatures class except that it hashes each dimension to a new fea...
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
A File access base class.
virtual void free_feature_iterator(void *iterator)
virtual EFeatureClass get_feature_class() const =0
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)
static void fill_vector(T *vec, int32_t len, T value)
EFeatureType
shogun feature type
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual CFeatures * duplicate() const
virtual EFeatureType get_feature_type() const
virtual void * get_feature_iterator(int32_t vector_index)
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
static SGSparseVector< ST > hash_vector(SGVector< ST > vec, int32_t dim, bool use_quadratic=false, bool keep_linear_terms=true)
virtual EFeatureType get_feature_type() const =0
SGSparseVectorEntry< T > * features