public abstract class AbstractPredictor extends ExecutableOperator
Constructor and Description |
---|
AbstractPredictor() |
Modifier and Type | Method and Description |
---|---|
protected void |
computeMetadata(StreamingMetadataContext ctx)
Default implementation of computeMetadata.
|
protected void |
execute(ExecutionContext ctx)
Invokes
execute(PMMLModel, RecordValued, ScalarSettable[]) and performs
an output.pushEndOfData() |
protected abstract void |
execute(PMMLModel model,
RecordValued input,
ScalarSettable[] predictedFields)
Called to perform prediction.
|
RecordPort |
getInput()
The input data.
|
PMMLPort |
getModel()
The input for supplying the PMML model
|
RecordPort |
getOutput()
The original data with prediction appended
|
protected abstract RecordTokenType |
predictedType(PMMLModelSpec modelSpec)
Given the model spec, returns the predicted type.
|
protected void |
pushPrediction()
Pushes a prediction row consisting of input fields plus predicted fields
|
protected boolean |
stepNext()
Steps to the next input row, returning false at end of data
|
cloneForExecution, getNumInputCopies, getPortSettings, handleInactiveOutput
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
public final RecordPort getInput()
public final PMMLPort getModel()
public RecordPort getOutput()
protected void computeMetadata(StreamingMetadataContext ctx)
predictedType
computeMetadata
in class StreamingOperator
ctx
- the contextprotected final boolean stepNext()
protected final void pushPrediction()
protected final void execute(ExecutionContext ctx)
execute(PMMLModel, RecordValued, ScalarSettable[])
and performs
an output.pushEndOfData()
execute
in class ExecutableOperator
ctx
- context in which to lookup physical ports bound to logical portsprotected abstract RecordTokenType predictedType(PMMLModelSpec modelSpec)
modelSpec
- the model metadataprotected abstract void execute(PMMLModel model, RecordValued input, ScalarSettable[] predictedFields)
stepNext()
. For each row of input, subclasses should first set the predicted values in
the predictedFields
array and then invoke pushPrediction()
.
Subclasses should not invoke pushEndOfData
since that is automatically handled by
the base class.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 by predictedType(PMMLModelSpec)
.Copyright © 2024 Actian Corporation. All rights reserved.