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.ConfiguredObjectProvenanceReturns Optional.empty() if it failed to process out a response.voidsetFieldName(String fieldName) Deprecated.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:ResponseProcessorGets the OutputFactory this ResponseProcessor uses.- Specified by:
getOutputFactoryin interfaceResponseProcessor<T extends Output<T>>- Returns:
- The output factory.
-
getFieldName
Description copied from interface:ResponseProcessorGets the field name this ResponseProcessor uses.- Specified by:
getFieldNamein interfaceResponseProcessor<T extends Output<T>>- Returns:
- The field name.
-
setFieldName
Deprecated.- Specified by:
setFieldNamein interfaceResponseProcessor<T extends Output<T>>- Parameters:
fieldName- The field name.
-
process
Description copied from interface:ResponseProcessorReturns Optional.empty() if it failed to process out a response.- Specified by:
processin interfaceResponseProcessor<T extends Output<T>>- Parameters:
value- The value to process.- Returns:
- The response value if found.
-
toString
-
getProvenance
-