Class Instance<U>

java.lang.Object
es.uam.eps.ir.relison.links.data.letor.Instance<U>
Type Parameters:
U - Type of the users of the graph.

public class Instance<U>
extends java.lang.Object
Machine learning individual pattern.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private int category
    Category.
    static int ERROR_CLASS
    Value to apply when the class is unknown or undefined.
    private U u
    Origin node.
    private U v
    Destination node.
    private java.util.List<java.lang.Double> values
    List of values.
  • Constructor Summary

    Constructors 
    Constructor Description
    Instance​(U u, U v, java.util.List<java.lang.Double> values)
    Constructor.This is useful if you do not want to assign a class to the pattern.
    Instance​(U u, U v, java.util.List<java.lang.Double> values, int category)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    int getCategory()
    Gets the class of the pattern.
    U getDest()
    Get the destination node.
    U getOrigin()
    Get the origin node.
    double getValue​(int attrId)
    Gets the value for a certain attribute.
    java.util.List<java.lang.Double> getValues()
    Gets the list of values for the different attributes in the pattern.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • u

      private final U u
      Origin node.
    • v

      private final U v
      Destination node.
    • category

      private int category
      Category.
    • values

      private final java.util.List<java.lang.Double> values
      List of values.
    • ERROR_CLASS

      public static final int ERROR_CLASS
      Value to apply when the class is unknown or undefined.
      See Also:
      Constant Field Values
  • Constructor Details

    • Instance

      public Instance​(U u, U v, java.util.List<java.lang.Double> values, int category)
      Constructor.
      Parameters:
      u - origin user.
      v - destination user.
      values - list that contains the values of the attributes.
      category - class which the pattern belongs to.
    • Instance

      public Instance​(U u, U v, java.util.List<java.lang.Double> values)
      Constructor.This is useful if you do not want to assign a class to the pattern.
      Parameters:
      u - origin user.
      v - destination user.
      values - list that contains the values of the attributes.
  • Method Details

    • getValues

      public java.util.List<java.lang.Double> getValues()
      Gets the list of values for the different attributes in the pattern.
      Returns:
      the list of attribute values.
    • getValue

      public double getValue​(int attrId)
      Gets the value for a certain attribute.
      Parameters:
      attrId - index of the attribute
      Returns:
      the value of the attribute.
    • getCategory

      public int getCategory()
      Gets the class of the pattern.
      Returns:
      the class of the pattern.
    • getOrigin

      public U getOrigin()
      Get the origin node.
      Returns:
      the origin node.
    • getDest

      public U getDest()
      Get the destination node.
      Returns:
      the destination node.