Class ClassificationRuleSet

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ContrastRuleSet

public class ClassificationRuleSet extends RuleSetBase
Class representing a set of classification rules.
See Also:
  • Field Details

    • ATTRIBUTE_VOTING_RESULTS_WEIGHTS

      public static final String ATTRIBUTE_VOTING_RESULTS_WEIGHTS
      Name of the prediction attribute representing results of voting (weights).
      See Also:
    • ATTRIBUTE_VOTING_RESULTS_COUNTS

      public static final String ATTRIBUTE_VOTING_RESULTS_COUNTS
      Name of the prediction attribute representing results of voting (counts).
      See Also:
  • Constructor Details

    • ClassificationRuleSet

      public ClassificationRuleSet(IExampleSet exampleSet, boolean isVoting, InductionParameters params, Knowledge knowledge)
      Invokes base class constructor.
      Parameters:
      exampleSet - Training set.
      isVoting - Voting flag.
      params - Induction parameters.
      knowledge - User's knowledge.
  • Method Details

    • setDefaultClass

      public void setDefaultClass(String defaultClass)
      Sets defaultClass
    • predict

      public double predict(Example example) throws OperatorException
      Predicts class label for a given example. Sets output attributes describing voting results.
      Specified by:
      predict in class RuleSetBase
      Parameters:
      example - Example to be examined.
      Returns:
      Predicted class label.
      Throws:
      OperatorException
    • apply

      public IExampleSet apply(IExampleSet exampleSet) throws OperatorException
      Applies the rule model on a given set (makes predictions for all examples).
      Overrides:
      apply in class PredictionModel
      Parameters:
      exampleSet - Example set to be examined.
      Returns:
      Example set with filled predictions and voting attributes.
      Throws:
      OperatorException
    • createPredictionAttributes

      protected IAttribute createPredictionAttributes(IExampleSet exampleSet, IAttribute label)
      Computes prediction attributes (voting results) for a given set.
      Overrides:
      createPredictionAttributes in class PredictionModel
      Parameters:
      exampleSet - Example set to be examined.
      label - Input label attribute.
      Returns:
      Output label attribute.