Class Instance

java.lang.Object
com.groiss.ml.ds.Instance

public class Instance extends Object
Represents a row in a DataSet. It consists of a set of Attribute and the values of these attributes for the row.
  • Constructor Details

    • Instance

      public Instance()
      Create a new empty instance.
  • Method Details

    • setValueFor

      public <T, V extends T> void setValueFor(Attribute<T> attribute, V value)
      Sets the value for an attribute.
      Parameters:
      attribute - the attribute which value shall be set
      value - the value for the attribute
    • hasAttribute

      public <T> boolean hasAttribute(Attribute<T> attribute)
      Checks if this instance contains the passed attribute
      Parameters:
      attribute - the Attribute to check for
      Returns:
      true if this instance contains the attribute, false otherwise
    • getValueFor

      public <T> T getValueFor(Attribute<T> attribute)
      Returns the value for the passed attribute for this instance
      Parameters:
      attribute - the Attribute which value is requested
      Returns:
      the value of the passed attribute