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 std::unique_ptr<IResettableStatisticsSubset> createStatisticsSubset(const IWeightedStatistics &statistics, const CompleteIndexVector &outputIndices) const override¶
Creates and returns an
IResettableStatisticsSubsetbased on given statistics and this feature vector.- Parameters:
statistics – A reference to an object of type
IWeightedStatisticss, the subset should be based onoutputIndices – A reference to an object of type
CompleteIndexVectorthat provides access to the indices of the outputs that should be included in the subset
- Returns:
An unique pointer to an object of type
IResettableStatisticsSubsetthat has been created
-
virtual std::unique_ptr<IResettableStatisticsSubset> createStatisticsSubset(const IWeightedStatistics &statistics, const PartialIndexVector &outputIndices) const override¶
Creates and returns an
IResettableStatisticsSubsetbased on given statistics and this feature vector.- Parameters:
statistics – A reference to an object of type
IWeightedStatisticss, the subset should be based onoutputIndices – A reference to an object of type
PartialIndexVectorthat provides access to the indices of the outputs that should be included in the subset
- Returns:
An unique pointer to an object of type
IResettableStatisticsSubsetthat has been created
-
virtual void searchForRefinement(SingleRefinementComparator &comparator, const IWeightedStatistics &statistics, const IIndexVector &outputIndices, 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:
comparator – A reference to an object of type
SingleRefinementComparatorthat should be used for comparing potential refinementsstatistics – A reference to an object of type
IWeightedStatisticsthat provides access to weighted statistics about the quality of predictions for training examples, which should serve as the basis for evaluating the quality of potential refinementsoutputIndices – A reference to an object of type
IIndexVectorthat provides access to the indices of the outputs for which refinements should predictnumExamplesWithNonZeroWeights – 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
Refinementthat should be used for storing the properties of the best refinement that is found
-
virtual void searchForRefinement(FixedRefinementComparator &comparator, const IWeightedStatistics &statistics, const IIndexVector &outputIndices, 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:
comparator – A reference to an object of type
MultiRefinementComparatorthat should be used for comparing potential refinementsstatistics – A reference to an object of type
IWeightedStatisticsthat provides access to weighted statistics about the quality of predictions for training examples, which should serve as the basis for evaluating the quality of potential refinementsoutputIndices – A reference to an object of type
IIndexVectorthat provides access to the indices of the outputs for which refinements should predictnumExamplesWithNonZeroWeights – 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
Refinementthat 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
CoverageMaskandIWeightedStatisticsdepending on the indices of training examples included in a specificInterval.- Parameters:
interval – A reference to an object of type
Intervalthat includes the indices of all covered training examplescoverageMask – A reference to an object of type
CoverageMaskthat should be updatedindicatorValue – The indicator value that should be used for updating the given
CoverageMaskstatistics – A reference to an object of type
IWeightedStatisticsthat 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
IFeatureVectorthat may be reused or a null pointer, if no such object is availableinterval – A reference to an object of type
Intervalthat includes the indices of the training examples to be retained
- Returns:
An unique pointer to an object of type
IFeatureVectorthat 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
IFeatureVectorthat may be reused or a null pointer, if no such object is availablecoverageMask – A reference to an object of type
CoverageMaskthat specifies the indices of the training examples to be retained
- Returns:
An unique pointer to an object of type
IFeatureVectorthat has been created
-
virtual std::unique_ptr<IResettableStatisticsSubset> createStatisticsSubset(const IWeightedStatistics &statistics, const CompleteIndexVector &outputIndices) const override¶