File feature_vector_equal.hpp¶
-
class EqualFeatureVector : public IFeatureVector¶
- #include <feature_vector_equal.hpp>
A feature vector that does not actually store any values. It is used in cases where all training examples have the same value for a certain feature.
Public Functions
-
virtual void searchForRefinement(FeatureBasedSearch &featureBasedSearch, IWeightedStatisticsSubset &statisticsSubset, SingleRefinementComparator &comparator, uint32 numExamlesWithNonZeroWeights, uint32 minCoverage, Refinement &refinement) const override¶
Conducts a search for the best refinement of an existing rule that can be created from a this feature vector.
- Parameters:
featureBasedSearch – A reference to an object of type
FeatureBasedSearch
that should be used for conducting the searchstatisticsSubset – A reference to an object of type
IWeightedStatisticsSubset
that provides access to weighted statistics about the labels of the training examples, which should serve as the basis for evaluating the quality of potential refinementscomparator – A reference to an object of type
SingleRefinementComparator
that should be used for comparing potential refinementsnumExamplesWithNonZeroWeights – The total number of examples with non-zero weights that may be covered by a refinement
minCoverage – The minimum number of examples that must be covered by the refinement
refinement – A reference to an object of type
Refinement
that should be used for storing the properties of the best refinement that is found
-
virtual void searchForRefinement(FeatureBasedSearch &featureBasedSearch, IWeightedStatisticsSubset &statisticsSubset, FixedRefinementComparator &comparator, uint32 numExamlesWithNonZeroWeights, uint32 minCoverage, Refinement &refinement) const override¶
Conducts a search for the best refinement of an existing rule that can be created from a this feature vector.
- Parameters:
featureBasedSearch – A reference to an object of type
FeatureBasedSearch
that should be used for conducting the searchstatisticsSubset – A reference to an object of type
IWeightedStatisticsSubset
that provides access to weighted statistics about the labels of the training examples, which should serve as the basis for evaluating the quality of potential refinementscomparator – A reference to an object of type
MultiRefinementComparator
that should be used for comparing potential refinementsnumExamplesWithNonZeroWeights – The total number of examples with non-zero weights that may be covered by a refinement
minCoverage – The minimum number of examples that must be covered by the refinement
refinement – A reference to an object of type
Refinement
that should be used for storing the properties of the best refinement that is found
-
virtual void updateCoverageMaskAndStatistics(const Interval &interval, CoverageMask &coverageMask, uint32 indicatorValue, IWeightedStatistics &statistics) const override¶
Updates a given
CoverageMask
andIWeightedStatistics
depending on the indices of training examples included in a specificInterval
.- Parameters:
interval – A reference to an object of type
Interval
that includes the indices of all covered training examplescoverageMask – A reference to an object of type
CoverageMask
that should be updatedindicatorValue – The indicator value that should be used for updating the given
CoverageMask
statistics – A reference to an object of type
IWeightedStatistics
that should be updated
-
virtual std::unique_ptr<IFeatureVector> createFilteredFeatureVector(std::unique_ptr<IFeatureVector> &existing, const Interval &interval) const override¶
Creates and returns a copy of this vector that does only store the feature values of training examples included in a given
Interval
.- Parameters:
existing – A reference to an unique pointer that stores an object of type
IFeatureVector
that may be reused or a null pointer, if no such object is availableinterval – A reference to an object of type
Interval
that includes the indices of the training examples to be retained
- Returns:
An unique pointer to an object of type
IFeatureVector
that has been created
-
virtual std::unique_ptr<IFeatureVector> createFilteredFeatureVector(std::unique_ptr<IFeatureVector> &existing, const CoverageMask &coverageMask) const override¶
Creates and returns a copy of this vector that does only store the feature values of training examples marked as covered according to a given
CoverageMask
.- Parameters:
existing – A reference to an unique pointer that stores an object of type
IFeatureVector
that may be reused or a null pointer, if no such object is availablecoverageMask – A reference to an object of type
CoverageMask
that specifies the indices of the training examples to be retained
- Returns:
An unique pointer to an object of type
IFeatureVector
that has been created
-
virtual void searchForRefinement(FeatureBasedSearch &featureBasedSearch, IWeightedStatisticsSubset &statisticsSubset, SingleRefinementComparator &comparator, uint32 numExamlesWithNonZeroWeights, uint32 minCoverage, Refinement &refinement) const override¶