28 m_num_vectors = num_vecs;
29 m_num_features = num_feats;
44 REQUIRE(feats.
num_cols == feat_length*num_vecs,
"The number of columns of feats " 45 "must be equal to feat_length times num_vecs\n");
78 SG_ERROR(
"The index of the feature vector to get must be between " 82 return m_features[num];
92 SG_ERROR(
"The index of the feature vector to get must be between " 97 int32_t num_cols = m_features[num].num_cols;
98 int32_t num_rows = m_features[num].num_rows;
100 if ( col < 0 || col >= num_cols )
102 SG_ERROR(
"The index of the column to get must be between " 103 "0 and %d (#columns of the feature vector)\n", num_cols);
108 SG_ERROR(
"The vector out must have space to hold at least " 112 int32_t start = col*num_rows;
115 out[i] = m_features[num][start + i];
125 SG_ERROR(
"The index of the feature vector to set must be between " 131 SG_ERROR(
"The feature vector to set must have the same features " 132 "as the rest of the MatrixFeatures, %d " 142 m_features = features;
144 m_num_features = num_feats;
149 SG_ADD(&m_num_vectors,
"m_num_vectors",
"Number of feature vectors",
151 SG_ADD(&m_num_features,
"m_num_features",
172 "base_features must be of dynamic type CMatrixFeatures\n")
virtual ~CMatrixFeatures()
virtual CFeatures * duplicate() const
void set_features(SGMatrixList< ST > features, int32_t num_feats)
static SGMatrixList< T > split(SGMatrix< T > matrix, int32_t num_components)
static CMatrixFeatures * obtain_from_generic(CFeatures *const base_features)
SGMatrix< ST > get_feature_vector(int32_t num) const
void get_feature_vector_col(SGVector< ST > out, int32_t num, int32_t col) const
virtual EFeatureClass get_feature_class() const
EFeatureClass
shogun feature class
int32_t get_num_features() const
void set_matrix(index_t index, const SGMatrix< T > matrix)
virtual EFeatureClass get_feature_class() const =0
EFeatureType
shogun feature type
all of classes and functions are contained in the shogun namespace
Class CMatrixFeatures used to represent data whose feature vectors are better represented with matric...
The class Features is the base class of all feature objects.
virtual EFeatureType get_feature_type() const
virtual int32_t get_num_vectors() const
void set_feature_vector(SGMatrix< ST > const vec, int32_t num)