Class RegressionPredictor

All Implemented Interfaces:
LogicalOperator

public class RegressionPredictor extends AbstractPredictor
Apply a regression model to the input data. The model defines the independent variables used to create the model. The input data must contain the same independent variables as fields in the data flow. The predicted value is added to the output data flow. All input fields are also transferred to the output.
  • Field Details

  • Constructor Details

    • RegressionPredictor

      public RegressionPredictor()
      Construct a new operator instance.
  • Method Details

    • getPredictedFieldSuffix

      public String getPredictedFieldSuffix()
      Get the suffix to add to the target field name.
      Returns:
      target field name suffix
    • setPredictedFieldSuffix

      public void setPredictedFieldSuffix(String predictedFieldSuffix)
      Set the suffix to be added to the target field name. The suffix is set to "(predicted)" by default.
      Parameters:
      predictedFieldSuffix - target field name suffix
    • predictedType

      protected RecordTokenType predictedType(PMMLModelSpec modelSpec)
      Description copied from class: AbstractPredictor
      Given the model spec, returns the predicted type. This should not include the input type ( the input is automatically prepended to the type that is returned )
      Specified by:
      predictedType in class AbstractPredictor
      Parameters:
      modelSpec - the model metadata
      Returns:
      the predicted type
    • execute

      protected void execute(PMMLModel model, RecordValued input, ScalarSettable[] predictedFields)
      Description copied from class: AbstractPredictor
      Called to perform prediction. Subclasses are expected to loop over the input by calling AbstractPredictor.stepNext(). For each row of input, subclasses should first set the predicted values in the predictedFields array and then invoke AbstractPredictor.pushPrediction(). Subclasses should not invoke pushEndOfData since that is automatically handled by the base class.
      Specified by:
      execute in class AbstractPredictor
      Parameters:
      model - The input PMML model
      input - The input data
      predictedFields - An array of fields that reference the predicted field locations. The array positionally corresponds to the type returned by AbstractPredictor.predictedType(PMMLModelSpec).