public static final class Regressor.DimensionTuple extends Regressor
Regressor
which contains a single dimension, used internally
when the model implementation doesn't natively support multi-dimensional
regression outputs.Regressor.DimensionTuple
DEFAULT_NAME, TOLERANCE
Constructor and Description |
---|
DimensionTuple(String name,
double value)
Creates a dimension tuple from the supplied name and value.
|
DimensionTuple(String name,
double value,
double variance)
Creates a dimension tuple from the supplied name, value and variance.
|
Modifier and Type | Method and Description |
---|---|
Regressor.DimensionTuple |
copy()
Deep copy of the output up to it's immutable state.
|
boolean |
equals(Object o)
Regressors are equal if they have the same number of dimensions and equal dimension names.
|
boolean |
fullEquals(Regressor other)
Compares other to this output.
|
Optional<Regressor.DimensionTuple> |
getDimension(String name)
Returns a dimension tuple for the requested dimension, or optional empty if
it's not valid.
|
String |
getDimensionNamesString()
Returns a comma separated list of the dimension names.
|
String |
getName()
Returns the name.
|
String |
getSerializableForm(boolean includeConfidence)
Generates a String suitable for writing to a csv or json file.
|
double |
getValue()
Returns the value.
|
double |
getVariance()
Returns the variance.
|
int |
hashCode()
All regressors have a hashcode based on only the dimension names.
|
Iterator<Regressor.DimensionTuple> |
iterator() |
int |
size()
Returns the number of dimensions in this regressor.
|
String |
toString() |
createFromPairList, extractNames, getDimension, getDimensionNamesString, getNames, getValues, getVariances, parseElement, parseString, parseString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public DimensionTuple(String name, double value, double variance)
name
- The dimension name.value
- The dimension value.variance
- The variance of the value, if known. Otherwise Double.NaN
.public DimensionTuple(String name, double value)
Double.NaN
.name
- The dimension name.value
- The dimension value.public int size()
Regressor
public Optional<Regressor.DimensionTuple> getDimension(String name)
Regressor
getDimension
in class Regressor
name
- The dimension name.public Iterator<Regressor.DimensionTuple> iterator()
iterator
in interface Iterable<Regressor.DimensionTuple>
iterator
in class Regressor
public Regressor.DimensionTuple copy()
Output
public String getName()
public double getValue()
public double getVariance()
public String getSerializableForm(boolean includeConfidence)
Output
getSerializableForm
in interface Output<Regressor>
getSerializableForm
in class Regressor
includeConfidence
- Include whatever confidence score the label contains, if known.public boolean fullEquals(Regressor other)
Output
fullEquals
in interface Output<Regressor>
fullEquals
in class Regressor
other
- Another output instance.public boolean equals(Object o)
Regressor
public int hashCode()
public String getDimensionNamesString()
Regressor
getDimensionNamesString
in class Regressor
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.