File feature_vector_binned.hpp¶
-
class BinnedFeatureVector : public CompressedVector¶
- #include <feature_vector_binned.hpp>
A feature vector that stores the indices of the examples that are associated with each bin, except for the most frequent one, created by a method that assigns numerical feature values to bins.
Public Types
Public Functions
-
BinnedFeatureVector(float32 *thresholds, uint32 *indices, uint32 *indptr, uint32 numBins, uint32 numIndices, uint32 sparseBinIndex)¶
- Parameters:
thresholds – A pointer to an array of type
float32, shape(numBins - 1)that stores thresholds separating binsindices – A pointer to an array of type
uint32, shape(numIndices)that stores the indices of all examples not associated with the most frequent binindptr – A pointer to an array that stores the indices of the first element in
indicesthat corresponds to a certain binnumBins – The number of bins, including the most frequent one
numIndices – The number of elements in the array
indicessparseBinIndex – The index of the most frequent bin
-
BinnedFeatureVector(const BinnedFeatureVector &other)¶
- Parameters:
other – A reference to an object of type
BinnedFeatureVectorthat should be copied
-
BinnedFeatureVector(BinnedFeatureVector &&other)¶
- Parameters:
other – A reference to an object of type
BinnedFeatureVectorthat should be moved
-
inline virtual ~BinnedFeatureVector() override¶
-
threshold_const_iterator thresholds_cbegin() const¶
Returns a
threshold_const_iteratorto the beginning of the thresholds.- Returns:
A
threshold_const_iteratorto the beginning
-
threshold_const_iterator thresholds_cend() const¶
Returns a
value_const_iteratorto the end of the thresholds.- Returns:
A
value_const_iteratorto the end
-
threshold_iterator thresholds_begin()¶
Returns a
value_iteratorto the beginning of the thresholds.- Returns:
A
value_iteratorto the beginning
-
threshold_iterator thresholds_end()¶
Returns a
threshold_iteratorto the end of the thresholds.- Returns:
A
threshld_iteratorto the end
-
threshold_type *releaseThresholds()¶
Releases the ownership of the array that stores the thresholds. 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 thresholds
-
BinnedFeatureVector(float32 *thresholds, uint32 *indices, uint32 *indptr, uint32 numBins, uint32 numIndices, uint32 sparseBinIndex)¶