TargetType
- The type of the target (ground truth).EstimateType
- The type of the estimate. Typically this is the same as TargetType,
but it does not have to be.public class DefaultWeightedTargetEstimatePair<TargetType,EstimateType> extends DefaultTargetEstimatePair<TargetType,EstimateType> implements WeightedTargetEstimatePair<TargetType,EstimateType>
TargetEstimatePair
with an additional weight field.Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_WEIGHT
The default weight is 1.0.
|
protected double |
weight
The weight.
|
estimate, target
Constructor and Description |
---|
DefaultWeightedTargetEstimatePair()
Creates a new
WeightedTargetEstimatePair with nulls for the
target and estimate and 1.0 for the weight. |
DefaultWeightedTargetEstimatePair(DefaultWeightedTargetEstimatePair<? extends TargetType,? extends EstimateType> other)
Creates a new
WeightedTargetEstimatePair as a shallow copy of
the given other object. |
DefaultWeightedTargetEstimatePair(TargetType target,
EstimateType estimate,
double weight)
Creates a new
WeightedTargetEstimatePair with the given target,
estimate, and weight. |
Modifier and Type | Method and Description |
---|---|
static <TargetType,EstimateType> |
create()
Convenience method for creating a new
DefaultWeightedTargetEstimatePair . |
static <TargetType,EstimateType> |
create(TargetType target,
EstimateType estimate)
Convenience method for creating a new
DefaultWeightedTargetEstimatePair . |
static <TargetType,EstimateType> |
create(TargetType target,
EstimateType estimate,
double weight)
Convenience method for creating a new
DefaultWeightedTargetEstimatePair . |
double |
getWeight()
Gets the weight of the object.
|
void |
setWeight(double weight)
Sets the weight.
|
clone, getEstimate, getTarget, mergeCollections, setEstimate, setTarget
getFirst, getSecond, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEstimate, getTarget
public static final double DEFAULT_WEIGHT
protected double weight
public DefaultWeightedTargetEstimatePair()
WeightedTargetEstimatePair
with nulls for the
target and estimate and 1.0 for the weight.public DefaultWeightedTargetEstimatePair(TargetType target, EstimateType estimate, double weight)
WeightedTargetEstimatePair
with the given target,
estimate, and weight.target
- The target.estimate
- The estimate.weight
- The eight.public DefaultWeightedTargetEstimatePair(DefaultWeightedTargetEstimatePair<? extends TargetType,? extends EstimateType> other)
WeightedTargetEstimatePair
as a shallow copy of
the given other object.other
- The other object to get the target, estimate, and weight from.public double getWeight()
Weighted
public void setWeight(double weight)
weight
- The weight for the pair.public static <TargetType,EstimateType> DefaultWeightedTargetEstimatePair<TargetType,EstimateType> create()
DefaultWeightedTargetEstimatePair
.TargetType
- The target (ground-truth) type.EstimateType
- The estimate (prediction) type. Usually the same as TargetType.public static <TargetType,EstimateType> DefaultWeightedTargetEstimatePair<TargetType,EstimateType> create(TargetType target, EstimateType estimate)
DefaultWeightedTargetEstimatePair
.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.public static <TargetType,EstimateType> DefaultWeightedTargetEstimatePair<TargetType,EstimateType> create(TargetType target, EstimateType estimate, double weight)
DefaultWeightedTargetEstimatePair
.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.weight
- The weight for the pair.