Class ContrastRuleSet

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ContrastRegressionRuleSet, ContrastSurvivalRuleSet

public class ContrastRuleSet extends ClassificationRuleSet
See Also:
  • Field Details

  • Constructor Details

    • ContrastRuleSet

      public ContrastRuleSet(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

    • getAllSets

      public List<ContrastRule> getAllSets()
    • getTotalDuplicates

      public int getTotalDuplicates()
    • calculateAvgContrastIndicators

      public ContrastIndicators calculateAvgContrastIndicators()
      Calculates contrast sets indicators averaged within contrasts and then between contrasts.
      Returns:
      Contrast set indicators.
    • calculateAttributeStats

      public double[] calculateAttributeStats()
    • add

      public void add(String positiveClass, String negativeClass, ContrastRule rule)
    • predict

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

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

      public String toString()
      Generates text representation of the rule set which contains:

      • induction parameters,
      • user's knowledge (if defined),
      • list of rules,
      • information about coverage of the training set examples.
      Overrides:
      toString in class RuleSetBase
      Returns:
      Rule set in the text form.