|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.sandia.cognition.util.AbstractCloneableSerializable
gov.sandia.cognition.learning.data.AbstractTargetEstimatePair<TargetType,EstimateType>
gov.sandia.cognition.learning.data.DefaultTargetEstimatePair<TargetType,EstimateType>
TargetType
- The type of the target (ground-truth).EstimateType
- The type of the estimate (prediction).public class DefaultTargetEstimatePair<TargetType,EstimateType>
A default implementation of the TargetEstimatePair
. This is useful
when keeping track of both a target (ground-truth) and an estimate
(prediction), for example when estimating the performance of a function.
Field Summary | |
---|---|
protected EstimateType |
estimate
Estimate (prediction) of the target value. |
protected TargetType |
target
Target (ground-truth) value. |
Constructor Summary | |
---|---|
DefaultTargetEstimatePair()
Creates a new instance of TargetEstimatePair , with null target
and estimate values. |
|
DefaultTargetEstimatePair(Pair<? extends TargetType,? extends EstimateType> other)
Creates a shallow copy of another target-estimate pair. |
|
DefaultTargetEstimatePair(TargetType target,
EstimateType estimate)
Creates a new instance of TargetEstimatePair with the given
target and estimate values. |
Method Summary | ||
---|---|---|
DefaultTargetEstimatePair<TargetType,EstimateType> |
clone()
This makes public the clone method on the Object class and
removes the exception that it throws. |
|
static
|
create()
Convenience method for creating a new DefaultTargetEstimatePair . |
|
static
|
create(TargetType target,
EstimateType estimate)
Convenience method for creating a new DefaultTargetEstimatePair . |
|
EstimateType |
getEstimate()
Gets the estimate, which is the prediction or guess. |
|
TargetType |
getTarget()
Gets the target, which is the ground-truth or actual value. |
|
static
|
mergeCollections(Collection<? extends TargetType> targets,
Collection<? extends EstimateType> estimates)
Merges together two Collections into a single target-estimate pair Collection. |
|
void |
setEstimate(EstimateType estimate)
Sets the estimate, which is the prediction or guess. |
|
void |
setTarget(TargetType target)
Sets the target, which is the ground-truth or actual value. |
Methods inherited from class gov.sandia.cognition.learning.data.AbstractTargetEstimatePair |
---|
getFirst, getSecond, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected TargetType target
protected EstimateType estimate
Constructor Detail |
---|
public DefaultTargetEstimatePair()
TargetEstimatePair
, with null target
and estimate values.
public DefaultTargetEstimatePair(TargetType target, EstimateType estimate)
TargetEstimatePair
with the given
target and estimate values.
target
- Target (ground-truth) value.estimate
- Estimate (prediction) of the target value.public DefaultTargetEstimatePair(Pair<? extends TargetType,? extends EstimateType> other)
other
- TargetEstimatePair to shallow copy.Method Detail |
---|
public static <TargetType,EstimateType> ArrayList<DefaultTargetEstimatePair<TargetType,EstimateType>> mergeCollections(Collection<? extends TargetType> targets, Collection<? extends EstimateType> estimates)
TargetType
- The target type.EstimateType
- The estimate type.targets
- Collection of targets, must be same size as estimatesestimates
- Collection of estimates, must be same size as targets
public DefaultTargetEstimatePair<TargetType,EstimateType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.
clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public TargetType getTarget()
public void setTarget(TargetType target)
target
- The target (ground-truth) value.public EstimateType getEstimate()
public void setEstimate(EstimateType estimate)
estimate
- The target (predicted) value.public static <TargetType,EstimateType> DefaultTargetEstimatePair<TargetType,EstimateType> create()
DefaultTargetEstimatePair
.
TargetType
- The target (ground-truth) type.EstimateType
- The estimate (prediction) type. Usually the same as TargetType.
public static <TargetType,EstimateType> DefaultTargetEstimatePair<TargetType,EstimateType> create(TargetType target, EstimateType estimate)
DefaultTargetEstimatePair
.
TargetType
- The target (ground-truth) type.EstimateType
- The estimate (prediction) type. Usually the same as TargetType.target
- The target (ground-truth) value.estimate
- The estimate (prediction) value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |