Class SurvivalRuleSet

All Implemented Interfaces:
Serializable

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

    • ATTRIBUTE_ESTIMATOR

      public static final String ATTRIBUTE_ESTIMATOR
      Name of the prediction attribute representing survival function estimator (in a text form).
      See Also:
    • ANNOTATION_TRAINING_ESTIMATOR

      public static final String ANNOTATION_TRAINING_ESTIMATOR
      Annotation representing survival function estimator of the training set (in a text form).
      See Also:
    • ANNOTATION_TRAINING_ESTIMATOR_REV

      public static final String ANNOTATION_TRAINING_ESTIMATOR_REV
      Annotation storing reveresed survival estimator of the training set (in a text form).
      See Also:
    • trainingEstimator

      protected KaplanMeierEstimator trainingEstimator
      Training set estimator.
  • Constructor Details

    • SurvivalRuleSet

      public SurvivalRuleSet(IExampleSet exampleSet, boolean isVoting, InductionParameters params, Knowledge knowledge)
      Invokes base class constructor and calculates survival function estimator for the training set.
      Parameters:
      exampleSet - Training set.
      isVoting - Voting flag.
      params - Induction parameters.
      knowledge - User's knowledge.
  • Method Details

    • getTrainingEstimator

      public KaplanMeierEstimator getTrainingEstimator()
    • predict

      public double predict(Example example)
      Estimates survival function for a given example and stores in a text form in ATTRIBUTE_ESTIMATOR attribute.
      Specified by:
      predict in class RuleSetBase
      Parameters:
      example - Example to be examined.
      Returns:
      Should be ignored (always 0).
    • apply

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

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

      public String toString()
      Generates text representation of the survival rule set. Beside list of rules, it contains survival function estimates of the entire training set and particular rules.
      Overrides:
      toString in class RuleSetBase
      Returns:
      Rule set in the text form.