Package org.tribuo.regression
Class RegressionInfo
java.lang.Object
org.tribuo.regression.RegressionInfo
- All Implemented Interfaces:
Serializable
,OutputInfo<Regressor>
,ProtoSerializable<org.tribuo.protos.core.OutputDomainProto>
- 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 TypeFieldDescriptionThe occurrence count per dimension.The maximum values seen per dimension.The mean value per dimension.The minimum values seen per dimension.protected long
The overall number ofRegressor
objects this object has seen.Sum of the squared differences per dimension.protected int
The number of unknownRegressor
s this object has seen.Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
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
Methods inherited from interface org.tribuo.protos.ProtoSerializable
serialize
-
Field Details
-
maxMap
The maximum values seen per dimension. -
minMap
The minimum values seen per dimension. -
meanMap
The mean value per dimension. -
sumSquaresMap
Sum of the squared differences per dimension. -
countMap
The occurrence count per dimension. -
overallCount
protected long overallCountThe overall number ofRegressor
objects this object has seen. -
unknownCount
protected int unknownCountThe number of unknownRegressor
s this object has seen.
-
-
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.
-