Class QuartileResponseProcessor<T extends Output<T>>
java.lang.Object
org.tribuo.data.columnar.processors.response.QuartileResponseProcessor<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 QuartileResponseProcessor<T extends Output<T>>
extends Object
implements ResponseProcessor<T>
Processes the response into quartiles and emits them as classification outputs.
The emitted outputs for each field are of the form:
{<fieldName>:first, <fieldName>:second, <fieldName>:third, <fieldName>:fourth}
.
-
Constructor Summary
ConstructorDescriptionQuartileResponseProcessor
(String name, String fieldName, Quartile quartile, OutputFactory<T> outputFactory) Constructs a response processor which emits 4 distinct bins for the output factory to process.QuartileResponseProcessor
(List<String> fieldNames, List<Quartile> quartiles, OutputFactory<T> outputFactory) Constructs a response processor which emits 4 distinct bins for the output factory to process. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets the field names this ResponseProcessor uses.Gets the OutputFactory this ResponseProcessor uses.com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
void
Deprecated.Returns Optional.empty() if it failed to process out a response.This method has a default implementation for backwards compatibility with Tribuo 4.0 and 4.1.void
setFieldName
(String fieldName) Deprecated.toString()
-
Constructor Details
-
QuartileResponseProcessor
public QuartileResponseProcessor(String name, String fieldName, Quartile quartile, OutputFactory<T> outputFactory) Constructs a response processor which emits 4 distinct bins for the output factory to process.This works best with classification outputs as the discrete binning is tricky to do in other output types.
- Parameters:
name
- The output string to emit.fieldName
- The field to read.quartile
- The quartile range to use.outputFactory
- The output factory to use.
-
QuartileResponseProcessor
public QuartileResponseProcessor(List<String> fieldNames, List<Quartile> quartiles, OutputFactory<T> outputFactory) Constructs a response processor which emits 4 distinct bins for the output factory to process.This works best with classification outputs as the discrete binning is tricky to do in other output types.
- Parameters:
fieldNames
- The field to read.quartiles
- The quartile range to use.outputFactory
- The output factory to use.
-
-
Method Details
-
postConfig
- Specified by:
postConfig
in interfacecom.oracle.labs.mlrg.olcut.config.Configurable
- Throws:
com.oracle.labs.mlrg.olcut.config.PropertyException
IOException
-
setFieldName
Deprecated.- Specified by:
setFieldName
in interfaceResponseProcessor<T extends Output<T>>
- Parameters:
fieldName
- The field name.
-
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
Deprecated.- Specified by:
getFieldName
in interfaceResponseProcessor<T extends Output<T>>
- Returns:
- The field name.
-
process
Deprecated.- Specified by:
process
in interfaceResponseProcessor<T extends Output<T>>
- Parameters:
value
- The value to process.- Returns:
- The response value if found.
-
process
Description copied from interface:ResponseProcessor
Returns Optional.empty() if it failed to process out a response.This method has a default implementation for backwards compatibility with Tribuo 4.0 and 4.1. This method should be overridden by code which depends on newer versions of Tribuo. The default implementation will be removed when the deprecated members are removed. Unless is is overridden it will throw anIllegalArgumentException
when called with multiple values.- Specified by:
process
in interfaceResponseProcessor<T extends Output<T>>
- Parameters:
values
- The value to process.- Returns:
- The response values if found.
-
getFieldNames
Description copied from interface:ResponseProcessor
Gets the field names this ResponseProcessor uses.- Specified by:
getFieldNames
in interfaceResponseProcessor<T extends Output<T>>
- Returns:
- The field names.
-
toString
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
-