public class TrainingInstance extends java.lang.Object implements Instance
| Constructor and Description |
|---|
TrainingInstance(@NotNull AttributeMap features,
@NotNull GroundTruth groundTruth)
Creates a new training instance with weight 1.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
@NotNull GroundTruth |
getGroundTruth()
Returns the ground truth of the instance.
|
@Nullable java.lang.Double |
getValue(int attributeIndex)
Returns the value that is associated with the
Attribute with a specific index. |
double |
getWeight()
Returns the weight of the object.
|
int |
hashCode() |
void |
setWeight(double weight)
Sets the weight of the object.
|
int |
size()
Returns the number of attribute-value mappings that are contained by the map.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, contains, getValue, isEmptypublic TrainingInstance(@NotNull
@NotNull AttributeMap features,
@NotNull
@NotNull GroundTruth groundTruth)
features - The features of the training instancegroundTruth - The ground truth of the training instancepublic int size()
AttributeMapsize in interface AttributeMap@Nullable public @Nullable java.lang.Double getValue(int attributeIndex)
AttributeMapAttribute with a specific index.getValue in interface AttributeMapattributeIndex - The index of the attribute for which the associated value should be
returned@NotNull public @NotNull GroundTruth getGroundTruth()
InstancegetGroundTruth in interface Instancepublic double getWeight()
Weightedpublic void setWeight(double weight)
Weightedpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object