File feature_vector.hpp¶
-
class IFeatureVector¶
- #include <feature_vector.hpp>
Defines an interface for all one-dimensional vectors that store the values of training examples for a certain feature.
Subclassed by EqualFeatureVector
Public Functions
-
inline virtual ~IFeatureVector()¶
-
virtual std::unique_ptr<IResettableStatisticsSubset> createStatisticsSubset(const IWeightedStatistics &statistics, const CompleteIndexVector &outputIndices) const = 0¶
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 = 0¶
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 numExamplesWithNonZeroWeights, uint32 minCoverage, Refinement &refinement) const = 0¶
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 numExamplesWithNonZeroWeights, uint32 minCoverage, Refinement &refinement) const = 0¶
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 = 0¶
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 = 0¶
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 = 0¶
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
-
inline virtual ~IFeatureVector()¶