Class PredictionModel

java.lang.Object
adaa.analytics.rules.logic.representation.ruleset.PredictionModel
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RuleSetBase

public abstract class PredictionModel extends Object implements Serializable
See Also:
  • Constructor Details

    • PredictionModel

      protected PredictionModel(IExampleSet trainingExampleSet)
  • Method Details

    • getTrainingHeader

      public IExampleSet getTrainingHeader()
    • performPrediction

      public abstract IExampleSet performPrediction(IExampleSet exampleSet, IAttribute predictedLabel) throws OperatorException
      Subclasses should iterate through the given example set and set the prediction for each example. The given predicted label attribute was already be added to the example set and should be used to set the predicted values.
      Throws:
      OperatorException
    • apply

      public IExampleSet apply(IExampleSet exampleSet) throws OperatorException
      Applies the model by creating a predicted label attribute and setting the predicted label values.
      Throws:
      OperatorException
    • getLabel

      public IAttribute getLabel()
      Returns the label attribute.
    • checkCompatibility

      protected void checkCompatibility(IExampleSet exampleSet) throws OperatorException
      This method is invoked before the model is actually applied. The default implementation performs some basic compatibility checks and writes warnings if the given example set (for applying the model) does not fit the training example set. Subclasses might override this method and might throw exceptions which will prevent the application of the model.
      Throws:
      OperatorException
    • createPredictionAttributes

      protected IAttribute createPredictionAttributes(IExampleSet exampleSet, IAttribute label)
      This method creates prediction attributes like the predicted label and confidences if needed.
    • supportsConfidences

      protected boolean supportsConfidences(IAttribute label)
      This method determines if confidence attributes are created depending on the current label. Usually this depends only on the fact that the label is nominal, but subclasses might override this to avoid attribute construction for confidences.