Class Dyad
- java.lang.Object
-
- ai.libs.jaicore.ml.ranking.dyad.learner.Dyad
-
- All Implemented Interfaces:
org.api4.java.ai.ml.ranking.dyad.dataset.IDyad
public class Dyad extends java.lang.Object implements org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRepresents a dyad consisting of an instance and an alternative, represented by feature vectors.
-
-
Constructor Summary
Constructors Constructor Description Dyad(org.api4.java.common.math.IVector instance, org.api4.java.common.math.IVector alternative)Construct a new dyad consisting of the given instance and alternative.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)org.api4.java.common.math.IVectorgetAlternative()Get the alternative.org.api4.java.common.math.IVectorgetContext()Get the instance.inthashCode()double[]toDoubleVector()java.lang.StringtoString()org.nd4j.linalg.api.ndarray.INDArraytoVector()Converts a dyad to aINDArrayrow vector consisting of a concatenation of the instance and alternative features.
-
-
-
Method Detail
-
getContext
public org.api4.java.common.math.IVector getContext()
Get the instance.- Specified by:
getContextin interfaceorg.api4.java.ai.ml.ranking.dyad.dataset.IDyad- Returns:
- the instance
-
getAlternative
public org.api4.java.common.math.IVector getAlternative()
Get the alternative.- Specified by:
getAlternativein interfaceorg.api4.java.ai.ml.ranking.dyad.dataset.IDyad- Returns:
- the alternative
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toVector
public org.nd4j.linalg.api.ndarray.INDArray toVector()
Converts a dyad to aINDArrayrow vector consisting of a concatenation of the instance and alternative features.- Returns:
- The dyad in
INDArrayrow vector form.
-
toDoubleVector
public double[] toDoubleVector()
- Specified by:
toDoubleVectorin interfaceorg.api4.java.ai.ml.ranking.dyad.dataset.IDyad
-
-