Class Regressor.DimensionTuple
java.lang.Object
org.tribuo.regression.Regressor
org.tribuo.regression.Regressor.DimensionTuple
- All Implemented Interfaces:
Serializable,Iterable<Regressor.DimensionTuple>,Output<Regressor>
- Enclosing class:
Regressor
-
Nested Class Summary
Nested classes/interfaces inherited from class org.tribuo.regression.Regressor
Regressor.DimensionTuple -
Field Summary
Fields inherited from class org.tribuo.regression.Regressor
DEFAULT_NAME, TOLERANCE -
Constructor Summary
ConstructorsConstructorDescriptionDimensionTuple(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. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Deep copy of the output up to it's immutable state.booleanRegressors are equal if they have the same number of dimensions and equal dimension names.booleanfullEquals(Regressor other) Compares other to this output.getDimension(String name) Returns a dimension tuple for the requested dimension, or optional empty if it's not valid.Returns a comma separated list of the dimension names.getName()Returns the name.getSerializableForm(boolean includeConfidence) Generates a String suitable for writing to a csv or json file.doublegetValue()Returns the value.doubleReturns the variance.inthashCode()All regressors have a hashcode based on only the dimension names.iterator()intsize()Returns the number of dimensions in this regressor.toString()Methods inherited from class org.tribuo.regression.Regressor
createFromPairList, extractNames, getDimension, getDimensionNamesString, getNames, getValues, getVariances, parseElement, parseString, parseStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DimensionTuple
Creates a dimension tuple from the supplied name, value and variance.- Parameters:
name- The dimension name.value- The dimension value.variance- The variance of the value, if known. OtherwiseDouble.NaN.
-
DimensionTuple
Creates a dimension tuple from the supplied name and value. Sets the variance toDouble.NaN.- Parameters:
name- The dimension name.value- The dimension value.
-
-
Method Details
-
size
-
toString
-
getDimension
Description copied from class:RegressorReturns a dimension tuple for the requested dimension, or optional empty if it's not valid.- Overrides:
getDimensionin classRegressor- Parameters:
name- The dimension name.- Returns:
- A tuple representing that dimension.
-
iterator
- Specified by:
iteratorin interfaceIterable<Regressor.DimensionTuple>- Overrides:
iteratorin classRegressor
-
copy
-
getName
-
getValue
public double getValue()Returns the value.- Returns:
- The value.
-
getVariance
public double getVariance()Returns the variance.- Returns:
- The variance.
-
getSerializableForm
Description copied from interface:OutputGenerates a String suitable for writing to a csv or json file.- Specified by:
getSerializableFormin interfaceOutput<Regressor>- Overrides:
getSerializableFormin classRegressor- Parameters:
includeConfidence- Include whatever confidence score the label contains, if known.- Returns:
- A String representation of this Output.
-
fullEquals
Description copied from interface:OutputCompares other to this output. Uses all score values and the strings.- Specified by:
fullEqualsin interfaceOutput<Regressor>- Overrides:
fullEqualsin classRegressor- Parameters:
other- Another output instance.- Returns:
- True if the other instance has value equality to this instance. False otherwise.
-
equals
Description copied from class:RegressorRegressors are equal if they have the same number of dimensions and equal dimension names. -
hashCode
-
getDimensionNamesString
Description copied from class:RegressorReturns a comma separated list of the dimension names.- Overrides:
getDimensionNamesStringin classRegressor- Returns:
- The dimension names comma separated.
-