Class DyadRankingInstance
- java.lang.Object
-
- ai.libs.jaicore.ml.dyadranking.dataset.ADyadRankingInstance
-
- ai.libs.jaicore.ml.dyadranking.dataset.DyadRankingInstance
-
- All Implemented Interfaces:
ILabeledInstance<IDyadRankingInstance>,IDyadRankingInstance,java.lang.Iterable<Dyad>
public class DyadRankingInstance extends ADyadRankingInstance
A general implementation of a dyad ranking instance that contains an immutable list of dyad to represent the ordering of dyads. The order is assumed to represent the ground truth (i.e., the label of the instance)
-
-
Constructor Summary
Constructors Constructor Description DyadRankingInstance(java.util.List<Dyad> dyads)Construct a new dyad ranking instance that saves the given ordering of dyads immutably.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)DyadgetDyadAtPosition(int position)Get the dyad at the specified position in the ordering contained in this instance.DyadRankingInstancegetTargetValue()Getter for the value of the target attribute.inthashCode()java.util.Iterator<Dyad>iterator()intlength()Get the number of dyads in the ranking.java.lang.StringtoString()-
Methods inherited from class ai.libs.jaicore.ml.dyadranking.dataset.ADyadRankingInstance
toMatrix
-
-
-
-
Constructor Detail
-
DyadRankingInstance
public DyadRankingInstance(java.util.List<Dyad> dyads)
Construct a new dyad ranking instance that saves the given ordering of dyads immutably.- Parameters:
dyads- the ordering of dyads to be stored in this instance
-
-
Method Detail
-
iterator
public java.util.Iterator<Dyad> iterator()
-
getDyadAtPosition
public Dyad getDyadAtPosition(int position)
Description copied from interface:IDyadRankingInstanceGet the dyad at the specified position in the ordering contained in this instance.- Parameters:
position- The position in the ordering for which to get the dyad- Returns:
- The dyad at the specified position
-
length
public int length()
Description copied from interface:IDyadRankingInstanceGet the number of dyads in the ranking.- Returns:
- The number of dyads in the ranking.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getTargetValue
public DyadRankingInstance getTargetValue()
Description copied from interface:ILabeledInstanceGetter for the value of the target attribute.- Returns:
- The value of the traget attribute.
-
-