Package org.tribuo.regression
Class RegressionInfo
java.lang.Object
org.tribuo.regression.RegressionInfo
- All Implemented Interfaces:
Serializable
,OutputInfo<Regressor>
- Direct Known Subclasses:
ImmutableRegressionInfo
,MutableRegressionInfo
The base class for regression information using
Regressor
s.
Stores the observed min, max, mean and variance for each dimension.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected long
protected int
-
Method Summary
Modifier and TypeMethodDescriptionabstract RegressionInfo
copy()
Generates a copy of this OutputInfo, including it's mutability.Generates anImmutableOutputInfo
which has a copy of the data in thisOutputInfo
, but also has id values and is immutable.Generates a mutable copy of thisOutputInfo
.Returns a set containing a Regressor for each dimension with the minimum value observed.double
Gets the maximum value this RegressionInfo has seen, or NaN if it's not seen that dimension.double
Gets the mean value this RegressionInfo has seen, or NaN if it's not seen that dimension.double
Gets the minimum value this RegressionInfo has seen, or NaN if it's not seen anything.int
Returns the number of unknownOutput
instances (generated byOutputFactory.getUnknownOutput()
) that this OutputInfo has seen.double
getVariance
(String name) Gets the variance this RegressionInfo has seen, or NaN if it's not seen that dimension.An Iterable over the possible outputs and the number of times they were observed.int
size()
The number of dimensions this OutputInfo has seen.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tribuo.OutputInfo
toReadableString
-
Field Details
-
maxMap
-
minMap
-
meanMap
-
sumSquaresMap
-
countMap
-
overallCount
protected long overallCount -
unknownCount
protected int unknownCount
-
-
Method Details
-
getUnknownCount
public int getUnknownCount()Description copied from interface:OutputInfo
Returns the number of unknownOutput
instances (generated byOutputFactory.getUnknownOutput()
) that this OutputInfo has seen.- Specified by:
getUnknownCount
in interfaceOutputInfo<Regressor>
- Returns:
- The number of unknown outputs observed.
-
getDomain
Returns a set containing a Regressor for each dimension with the minimum value observed.- Specified by:
getDomain
in interfaceOutputInfo<Regressor>
- Returns:
- A set of Regressors, each with one active dimension.
-
getMin
Gets the minimum value this RegressionInfo has seen, or NaN if it's not seen anything.- Parameters:
name
- The dimension to check.- Returns:
- The minimum value for that dimension.
-
getMax
Gets the maximum value this RegressionInfo has seen, or NaN if it's not seen that dimension.- Parameters:
name
- The dimension to check.- Returns:
- The maximum value for that dimension.
-
getMean
Gets the mean value this RegressionInfo has seen, or NaN if it's not seen that dimension.- Parameters:
name
- The dimension to check.- Returns:
- The mean value for that dimension.
-
getVariance
Gets the variance this RegressionInfo has seen, or NaN if it's not seen that dimension.- Parameters:
name
- The dimension to check.- Returns:
- The variance for that dimension.
-
size
public int size()The number of dimensions this OutputInfo has seen.- Specified by:
size
in interfaceOutputInfo<Regressor>
- Returns:
- The number of dimensions this OutputInfo has seen.
-
generateImmutableOutputInfo
Description copied from interface:OutputInfo
Generates anImmutableOutputInfo
which has a copy of the data in thisOutputInfo
, but also has id values and is immutable.- Specified by:
generateImmutableOutputInfo
in interfaceOutputInfo<Regressor>
- Returns:
- An immutable copy of this OutputInfo.
-
generateMutableOutputInfo
Description copied from interface:OutputInfo
Generates a mutable copy of thisOutputInfo
.- Specified by:
generateMutableOutputInfo
in interfaceOutputInfo<Regressor>
- Returns:
- A mutable copy of this OutputInfo.
-
copy
Description copied from interface:OutputInfo
Generates a copy of this OutputInfo, including it's mutability.- Specified by:
copy
in interfaceOutputInfo<Regressor>
- Returns:
- A copy of the OutputInfo.
-
outputCountsIterable
Description copied from interface:OutputInfo
An Iterable over the possible outputs and the number of times they were observed.Provides similar functionality to an iterator over the entrySet of a Map, though this is a copy of the data and immutable.
- Specified by:
outputCountsIterable
in interfaceOutputInfo<Regressor>
- Returns:
- Lambda wrapping an iterator over Pairs.
-