public class QuartileResponseProcessor<T extends Output<T>> extends Object implements ResponseProcessor<T>
The emitted outputs are of the form {<name>:first, <name>:second, <name>:third, <name>:fourth}
.
Constructor and Description |
---|
QuartileResponseProcessor(String name,
String fieldName,
Quartile quartile,
OutputFactory<T> outputFactory)
Constructs a repsonse processor which emits 4 distinct bins for the output factory to process.
|
Modifier and Type | Method and Description |
---|---|
String |
getFieldName()
Gets the field name this ResponseProcessor uses.
|
OutputFactory<T> |
getOutputFactory()
Gets the OutputFactory this ResponseProcessor uses.
|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
Optional<T> |
process(String value)
Returns Optional.empty() if it failed to process out a response.
|
void |
setFieldName(String fieldName)
Deprecated.
|
String |
toString() |
public QuartileResponseProcessor(String name, String fieldName, Quartile quartile, OutputFactory<T> outputFactory)
This works best with classification outputs as the discrete binning is tricky to do in other output types.
name
- The output string to emit.fieldName
- The field to read.quartile
- The quartile range to use.outputFactory
- The output factory to use.@Deprecated public void setFieldName(String fieldName)
setFieldName
in interface ResponseProcessor<T extends Output<T>>
fieldName
- The field name.public OutputFactory<T> getOutputFactory()
ResponseProcessor
getOutputFactory
in interface ResponseProcessor<T extends Output<T>>
public String getFieldName()
ResponseProcessor
getFieldName
in interface ResponseProcessor<T extends Output<T>>
public Optional<T> process(String value)
ResponseProcessor
process
in interface ResponseProcessor<T extends Output<T>>
value
- The value to process.public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.