Record Class CsvDataLoader.ClassificationData

java.lang.Object
java.lang.Record
com.knezevic.edaf.v3.problems.grammar.CsvDataLoader.ClassificationData
Enclosing class:
CsvDataLoader

public static record CsvDataLoader.ClassificationData(List<CsvDataLoader.ClassificationData.Row> rows, List<String> featureOrder, List<String> classValues, Map<String,Integer> classIndexByLabel) extends Record
Classification dataset rows and feature order.
  • Constructor Details

    • ClassificationData

      public ClassificationData(List<CsvDataLoader.ClassificationData.Row> rows, List<String> featureOrder, List<String> classValues, Map<String,Integer> classIndexByLabel)
      Creates an instance of a ClassificationData record class.
      Parameters:
      rows - the value for the rows record component
      featureOrder - the value for the featureOrder record component
      classValues - the value for the classValues record component
      classIndexByLabel - the value for the classIndexByLabel record component
  • Method Details

    • classCount

      public int classCount()
      Number of distinct classes.
    • classIndex

      public int classIndex(String label)
      Resolves class label into a dense class index.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • rows

      Returns the value of the rows record component.
      Returns:
      the value of the rows record component
    • featureOrder

      public List<String> featureOrder()
      Returns the value of the featureOrder record component.
      Returns:
      the value of the featureOrder record component
    • classValues

      public List<String> classValues()
      Returns the value of the classValues record component.
      Returns:
      the value of the classValues record component
    • classIndexByLabel

      public Map<String,Integer> classIndexByLabel()
      Returns the value of the classIndexByLabel record component.
      Returns:
      the value of the classIndexByLabel record component