File refinement_comparator_single.hpp¶
-
class SingleRefinementComparator¶
- #include <refinement_comparator_single.hpp>
Allows comparing potential refinements of a rule and keeping track of the best one.
Public Types
-
using iterator = Refinement*¶
An iterator that provides access to the refinements the comparator keeps track of and allows to modify them.
Public Functions
-
SingleRefinementComparator(RuleCompareFunction ruleCompareFunction)¶
- Parameters:
ruleCompareFunction – An object of type
RuleCompareFunctionthat defines the function that should be used for comparing the quality of different rules
-
SingleRefinementComparator(const SingleRefinementComparator &comparator)¶
- Parameters:
comparator – A reference to an object of type
SingleRefinementComparatorthat keeps track of the best refinement found so far
-
iterator begin()¶
Returns an
iteratorto the beginning of the refinements, starting with the best one.- Returns:
An
iteratorto the beginning
-
uint32 getNumElements() const¶
Returns the number of refinements the comparator keeps track of.
- Returns:
The number of refinements
-
bool isImprovement(const Quality &quality) const¶
Returns whether the quality of a rule’s predictions is considered as an improvement over the refinements that have been provided to this comparator so far.
- Parameters:
quality – A reference to an object of type
Qualitythat stores the quality of the predictions- Returns:
True, if the given quality is considered as an improvement, false otherwise
-
void pushRefinement(const Refinement &refinement, const IStatisticsUpdateCandidate &scores)¶
Keeps track of a given refinement of a rule that is considered as an improvement over the refinements that have been provided to this comparator so far.
- Parameters:
refinement – A reference to an object of type
Refinementthat represents the refinement of the rulescores – A reference to an object of type
IStatisticsUpdateCandidatethat stores the predictions of the rule
-
bool merge(SingleRefinementComparator &comparator)¶
Keeps track of the best refinement that is stored by a given
SingleRefinementComparatorif it is considered as an improvement over the best refinement that has been provided to this comparator.- Parameters:
comparator – A reference to an object of type
SingleRefinementComparatorthat should be merged- Returns:
True, if the best refinement that is stored by the given
comparatoris considered as an improvement over the best refinement that has been provided to this comparator
Private Members
-
const RuleCompareFunction ruleCompareFunction_¶
-
Refinement bestRefinement_¶
-
ScoreProcessor scoreProcessor_¶
-
using iterator = Refinement*¶