23 :
CDotFeatures(orig), m_bins(orig.m_bins), m_fill(orig.m_fill),
24 m_norm_one(orig.m_norm_one)
122 assert_shape(vec2_len);
142 result+=vec2[offs+j];
150 result+=vec2[offs+j];
166 assert_shape(vec2_len);
180 alpha_correction+=1.0;
184 if (alpha_correction==0.0)
216 void CBinnedDotFeatures::assert_shape(int32_t vec2_len)
220 SG_ERROR(
"Bin matrix has shape (%d,%d) = %d entries, not matching vector"
227 SG_ERROR(
"Number of colums (%d) doesn't match number of features "
300 void CBinnedDotFeatures::init()
309 return "BinnedDotFeatures";
CDenseFeatures< float64_t > * get_simple_features()
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
ST * get_feature_vector(int32_t num, int32_t &len, bool &dofree)
int32_t get_num_features() const
void set_norm_one(bool norm_one)
CBinnedDotFeatures(int32_t size=0)
#define SG_NOTIMPLEMENTED
CDenseFeatures< float64_t > * m_features
underlying features
void set_simple_features(CDenseFeatures< float64_t > *features)
Features that support dot products among other operations.
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
EFeatureClass
shogun feature class
virtual EFeatureClass get_feature_class() const
The class BinnedDotFeatures contains a 0-1 conversion of features into bins.
virtual int32_t get_num_vectors() const
virtual int32_t get_nnz_features_for_vector(int32_t num)
SGMatrix< float64_t > m_bins
bins with limits
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 EFeatureClass get_feature_class() const =0
T * get_column_vector(index_t col) const
void set_bins(SGMatrix< float64_t > bins)
bool m_fill
fill up with 1's or flag just one column
virtual int32_t get_dim_feature_space() const
virtual CFeatures * duplicate() const
EFeatureType
shogun feature type
virtual const char * get_name() const
virtual void free_feature_iterator(void *iterator)
all of classes and functions are contained in the shogun namespace
void free_feature_vector(ST *feat_vec, int32_t num, bool dofree)
virtual ~CBinnedDotFeatures()
The class Features is the base class of all feature objects.
bool m_norm_one
normalize vectors to have norm one
SGMatrix< float64_t > get_bins()
static float32_t sqrt(float32_t x)
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
virtual void * get_feature_iterator(int32_t vector_index)
virtual EFeatureType get_feature_type() const =0
virtual int32_t get_num_vectors() const
virtual EFeatureType get_feature_type() const