File feature_vector_nominal.hpp¶
-
class NominalFeatureVector : public CompressedVector¶
- #include <feature_vector_nominal.hpp>
A feature vector that stores the indices of the examples that are associated with each value, except for the majority value, i.e., the most frequent value, of a nominal feature.
Public Types
Public Functions
-
NominalFeatureVector(int32 *values, uint32 *indices, uint32 *indptr, uint32 numValues, uint32 numIndices, int32 majorityValue)¶
- Parameters:
values – A pointer to an array of type
int32, shape(numValues)that stores all nominal valuesindices – A pointer to an array of type
uint32, shape(numIndices)that stores the indices of all examples not associated with the majority valueindptr – A pointer to an array that stores the indices of the first element in
indicesthat corresponds to a certain value invaluesnumValues – The number of elements in the array
valuesnumIndices – The number of elements in the array
indicesmajorityValue – The majority value, i.e., the most frequent value, of the nominal feature
-
NominalFeatureVector(const NominalFeatureVector &other)¶
- Parameters:
other – A reference to an object of type
NominalFeatureVectorthat should be copied
-
NominalFeatureVector(NominalFeatureVector &&other)¶
- Parameters:
other – A reference to an object of type
NominalFeatureVectorthat should be moved
-
inline virtual ~NominalFeatureVector() override¶
-
value_const_iterator values_cbegin() const¶
Returns a
value_const_iteratorto the beginning of the nominal values.- Returns:
A
value_const_iteratorto the beginning
-
value_const_iterator values_cend() const¶
Returns a
value_const_iteratorto the end of the nominal values.- Returns:
A
value_const_iteratorto the end
-
value_iterator values_begin()¶
Returns a
value_iteratorto the beginning of the nominal values.- Returns:
A
value_iteratorto the beginning
-
value_iterator values_end()¶
Returns a
value_iteratorto the end of the nominal values.- Returns:
A
value_iteratorto the end
-
value_type *releaseValues()¶
Releases the ownership of the array that stores all nominal values. As a result, the behavior of this view becomes undefined and it should not be used anymore. The caller is responsible for freeing the memory that is occupied by the array.
- Returns:
A pointer to an array that stores all nominal values
-
NominalFeatureVector(int32 *values, uint32 *indices, uint32 *indptr, uint32 numValues, uint32 numIndices, int32 majorityValue)¶