File stopping_criterion.hpp

class IStoppingCriterion
#include <stopping_criterion.hpp>

Defines an interface for all stopping criteria that allow to decide whether additional rules should be induced or not.

Public Functions

inline virtual ~IStoppingCriterion()
virtual Result test(const IStatistics &statistics, uint32 numRules) = 0

Checks whether additional rules should be induced or not.

Parameters:
  • statistics – A reference to an object of type IStatistics that will serve as the basis for learning the next rule

  • numRules – The number of rules induced so far

Returns:

A value of the enum Result that specifies whether the induction of rules should be continued (CONTINUE), whether the current number of rules should be stored as a potential point for stopping while continuing to induce rules (STORE_STOP), or if the induction of rules should be forced to be stopped (FORCE_STOP)

struct Result
#include <stopping_criterion.hpp>

The result that is returned by a stopping criterion. It consists of the action to be executed, as well as the number of rules to be used, if the action is not CONTINUE.

Public Functions

inline Result()

Public Members

bool stop

True, if the induction of rules should be stopped, false otherwise.

uint32 numUsedRules

The number of rules to be used.

class IStoppingCriterionFactory
#include <stopping_criterion.hpp>

Defines an interface for all factories that allow to create instances of the type IStoppingCriterion.

Subclassed by StoppingCriterionListFactory

Public Functions

inline virtual ~IStoppingCriterionFactory()
virtual std::unique_ptr<IStoppingCriterion> create(const SinglePartition &partition) const = 0

Creates and returns a new object of type IStoppingCriterion.

Parameters:

partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that belong to the training set and the holdout set, respectively

Returns:

An unique pointer to an object of type IStoppingCriterion that has been created

virtual std::unique_ptr<IStoppingCriterion> create(BiPartition &partition) const = 0

Creates and returns a new object of type IStoppingCriterion.

Parameters:

partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that belong to the training set and the holdout set, respectively

Returns:

An unique pointer to an object of type IStoppingCriterion that has been created

class IStoppingCriterionConfig
#include <stopping_criterion.hpp>

Defines an interface for all classes that allow to configure a stopping criterion that allows to decide whether additional rules should be induced or not.

Subclassed by IGlobalPruningConfig, SizeStoppingCriterionConfig, TimeStoppingCriterionConfig

Public Functions

inline virtual ~IStoppingCriterionConfig()
virtual std::unique_ptr<IStoppingCriterionFactory> createStoppingCriterionFactory() const = 0

Creates and returns a new object of type IStoppingCriterionFactory according to the specified configuration.

Returns:

An unique pointer to an object of type IStoppingCriterionFactory that has been created