Module datarush.analytics
Class RegressionPredictor
java.lang.Object
com.pervasive.datarush.operators.AbstractLogicalOperator
com.pervasive.datarush.operators.StreamingOperator
com.pervasive.datarush.operators.ExecutableOperator
com.pervasive.datarush.analytics.util.AbstractPredictor
com.pervasive.datarush.analytics.regression.RegressionPredictor
- All Implemented Interfaces:
LogicalOperator
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default value forgetPredictedFieldSuffix(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute(PMMLModel model, RecordValued input, ScalarSettable[] predictedFields) Called to perform prediction.Get the suffix to add to the target field name.protected RecordTokenTypepredictedType(PMMLModelSpec modelSpec) Given the model spec, returns the predicted type.voidsetPredictedFieldSuffix(String predictedFieldSuffix) Set the suffix to be added to the target field name.Methods inherited from class com.pervasive.datarush.analytics.util.AbstractPredictor
computeMetadata, execute, getInput, getModel, getOutput, pushPrediction, stepNextMethods inherited from class com.pervasive.datarush.operators.ExecutableOperator
cloneForExecution, getNumInputCopies, getPortSettings, handleInactiveOutputMethods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Field Details
-
PREDICTED_SUFFIX
The default value forgetPredictedFieldSuffix().- See Also:
-
-
Constructor Details
-
RegressionPredictor
public RegressionPredictor()Construct a new operator instance.
-
-
Method Details
-
getPredictedFieldSuffix
Get the suffix to add to the target field name.- Returns:
- target field name suffix
-
setPredictedFieldSuffix
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
Description copied from class:AbstractPredictorGiven 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:
predictedTypein classAbstractPredictor- Parameters:
modelSpec- the model metadata- Returns:
- the predicted type
-
execute
Description copied from class:AbstractPredictorCalled to perform prediction. Subclasses are expected to loop over the input by callingAbstractPredictor.stepNext(). For each row of input, subclasses should first set the predicted values in thepredictedFieldsarray and then invokeAbstractPredictor.pushPrediction(). Subclasses should not invokepushEndOfDatasince that is automatically handled by the base class.- Specified by:
executein classAbstractPredictor- Parameters:
model- The input PMML modelinput- The input datapredictedFields- An array of fields that reference the predicted field locations. The array positionally corresponds to the type returned byAbstractPredictor.predictedType(PMMLModelSpec).
-