Class ClassificationExpertFinder

All Implemented Interfaces:
IExpertFinder, AutoCloseable

public class ClassificationExpertFinder extends ClassificationFinder implements IExpertFinder
Class for growing and pruning classification rules with user's knowledge.
  • Field Details

    • knowledge

      protected Knowledge knowledge
      User's knowledge.
  • Constructor Details

    • ClassificationExpertFinder

      public ClassificationExpertFinder(InductionParameters params, Knowledge knowledge)
      Invokes base class constructor and initializes knowledge object.
      Parameters:
      params - Induction parameters.
      knowledge - Expert knowledge.
  • Method Details

    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets users knowledge.
      Parameters:
      knowledge - User's knowledge to be set.
    • adjust

      public void adjust(Rule rule, IExampleSet dataset, Set<Integer> uncoveredPositives)
      Adjusts expert rule. The procedure specifies value sets of adjustable conditions, i.e., those in the form:
      • attribute ~= Any,
      • attribute ~= SomeSet (non-empty intersection of determined value set with SomeSet is required).
      Specified by:
      adjust in interface IExpertFinder
      Parameters:
      rule - Rule to be adjusted.
      dataset - Training dataset.
      uncoveredPositives - Set of positive examples not covered by the model.
    • grow

      public int grow(Rule rule, IExampleSet dataset, Set<Integer> uncoveredPositives)
      Adds elementary conditions to the classification rule premise until termination conditions are fulfilled. The method uses expert knowledge.
      Overrides:
      grow in class ClassificationFinder
      Parameters:
      rule - Rule to be grown.
      dataset - Training set.
      uncoveredPositives - Set of positive examples yet uncovered by the model.
      Returns:
      Number of conditions added.
    • checkCandidate

      protected boolean checkCandidate(ElementaryCondition cnd, double classId, double p, double n, double new_p, double P, double uncoveredSize, int ruleOrderNum)
      Checks if candidate condition fulfills coverage requirement and is not in conflict with forbidden knowledge.
      Overrides:
      checkCandidate in class ClassificationFinder
      Parameters:
      cnd - Candidate condition.
      classId - Class identifier.
      Returns: