Record Class SimpleTrainingTestSplit

java.lang.Object
java.lang.Record
org.coordinatekit.crf.mallet.train.SimpleTrainingTestSplit
Record Components:
training - the instances to use for model training
test - the instances to use for model evaluation; may be empty if MalletCrfTrainerConfiguration.trainingFraction() is 1.0
All Implemented Interfaces:
TrainingTestSplit

public record SimpleTrainingTestSplit(cc.mallet.types.InstanceList training, cc.mallet.types.InstanceList test) extends Record implements TrainingTestSplit
A container for training and test data splits.

This record holds the results of splitting a dataset into training and test sets. Both InstanceLists share the same Alphabet for features and LabelAlphabet for labels, ensuring consistent encoding across the split.

  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleTrainingTestSplit(cc.mallet.types.InstanceList training, cc.mallet.types.InstanceList test)
    Creates an instance of a SimpleTrainingTestSplit record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    cc.mallet.types.InstanceList
    Returns the value of the test record component.
    final String
    Returns a string representation of this record class.
    cc.mallet.types.InstanceList
    Returns the value of the training record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.coordinatekit.crf.mallet.train.TrainingTestSplit

    size
  • Constructor Details

    • SimpleTrainingTestSplit

      public SimpleTrainingTestSplit(cc.mallet.types.InstanceList training, cc.mallet.types.InstanceList test)
      Creates an instance of a SimpleTrainingTestSplit record class.
      Parameters:
      training - the value for the training record component
      test - the value for the test record component
  • Method Details

    • 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.
    • training

      public cc.mallet.types.InstanceList training()
      Returns the value of the training record component.
      Specified by:
      training in interface TrainingTestSplit
      Returns:
      the value of the training record component
    • test

      public cc.mallet.types.InstanceList test()
      Returns the value of the test record component.
      Specified by:
      test in interface TrainingTestSplit
      Returns:
      the value of the test record component