Class BinaryResponseProcessor<T extends Output<T>>
java.lang.Object
org.tribuo.data.columnar.processors.response.BinaryResponseProcessor<T>
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,ResponseProcessor<T>
public class BinaryResponseProcessor<T extends Output<T>>
extends Object
implements ResponseProcessor<T>
A
ResponseProcessor
that takes a single value of the
field as the positive class and all other values as the negative
class.-
Constructor Summary
ConstructorsConstructorDescriptionBinaryResponseProcessor
(String fieldName, String positiveResponse, OutputFactory<T> outputFactory) Constructs a binary response processor which emits a positive value for a single string and a negative value for all other field values. -
Method Summary
Modifier and TypeMethodDescriptionGets the field name this ResponseProcessor uses.Gets the OutputFactory this ResponseProcessor uses.com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
Returns Optional.empty() if it failed to process out a response.void
setFieldName
(String fieldName) Deprecated.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Constructor Details
-
BinaryResponseProcessor
public BinaryResponseProcessor(String fieldName, String positiveResponse, OutputFactory<T> outputFactory) Constructs a binary response processor which emits a positive value for a single string and a negative value for all other field values.- Parameters:
fieldName
- The field name to read.positiveResponse
- The positive response to look for.outputFactory
- The output factory to use.
-
-
Method Details
-
getOutputFactory
Description copied from interface:ResponseProcessor
Gets the OutputFactory this ResponseProcessor uses.- Specified by:
getOutputFactory
in interfaceResponseProcessor<T extends Output<T>>
- Returns:
- The output factory.
-
getFieldName
Description copied from interface:ResponseProcessor
Gets the field name this ResponseProcessor uses.- Specified by:
getFieldName
in interfaceResponseProcessor<T extends Output<T>>
- Returns:
- The field name.
-
setFieldName
Deprecated.- Specified by:
setFieldName
in interfaceResponseProcessor<T extends Output<T>>
- Parameters:
fieldName
- The field name.
-
process
Description copied from interface:ResponseProcessor
Returns Optional.empty() if it failed to process out a response.- Specified by:
process
in interfaceResponseProcessor<T extends Output<T>>
- Parameters:
value
- The value to process.- Returns:
- The response value if found.
-
toString
-
getProvenance
-