Module datarush.analytics
Class LogisticRegressionPredictor
- 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.LogisticRegressionPredictor
-
- All Implemented Interfaces:
LogicalOperator
public class LogisticRegressionPredictor extends AbstractPredictor
-
-
Constructor Summary
Constructors Constructor Description LogisticRegressionPredictor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
execute(PMMLModel pmml, RecordValued input, ScalarSettable[] predictedFields)
Called to perform prediction.String
getWinnerField()
Gets the name of the winner field to output.protected RecordTokenType
predictedType(PMMLModelSpec modelSpec)
Given the model spec, returns the predicted type.void
setWinnerField(String name)
Sets the name of the winner field to output.-
Methods inherited from class com.pervasive.datarush.analytics.util.AbstractPredictor
computeMetadata, execute, getInput, getModel, getOutput, pushPrediction, stepNext
-
Methods inherited from class com.pervasive.datarush.operators.ExecutableOperator
cloneForExecution, getNumInputCopies, getPortSettings, handleInactiveOutput
-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
-
-
-
Method Detail
-
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 classAbstractPredictor
- Parameters:
modelSpec
- the model metadata- Returns:
- the predicted type
-
getWinnerField
public String getWinnerField()
Gets the name of the winner field to output. This is "winner" by-default.- Returns:
- the name of the winner field to output.
-
setWinnerField
public void setWinnerField(String name)
Sets the name of the winner field to output. This is "winner" by-default.- Parameters:
winnerField
- the name of the winner field to output.
-
execute
protected void execute(PMMLModel pmml, RecordValued input, ScalarSettable[] predictedFields)
Description copied from class:AbstractPredictor
Called 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 thepredictedFields
array and then invokeAbstractPredictor.pushPrediction()
. Subclasses should not invokepushEndOfData
since that is automatically handled by the base class.- Specified by:
execute
in classAbstractPredictor
- Parameters:
pmml
- 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)
.
-
-