Record Class Evaluation

java.lang.Object
java.lang.Record
xyz.tcheeric.jev.Evaluation
Record Components:
model - the versioned model ID that actually answered, as the evaluator reported it. It is kept so a consumer can record which model produced each answer it calibrated on.

public record Evaluation(String model, Map<String,Answer> answers, Usage usage) extends Record
The answers to one fan-out of questions, keyed by the names the caller gave them, together with what the evaluation cost.

The typed accessors exist so a caller who asked a score question gets a score answer without casting. They retrieve; they do not judge. There is deliberately no method here that counts answers, compares them, or turns one into a decision (ADR 0002): four consumers are ranked for this library and each owns its own thresholds.

  • Constructor Details

    • Evaluation

      public Evaluation(String model, Map<String,Answer> answers, Usage usage)
      Creates an instance of a Evaluation record class.
      Parameters:
      model - the value for the model record component
      answers - the value for the answers record component
      usage - the value for the usage record component
  • Method Details

    • noul

      public Answer.Noul noul(String name)
    • choice

      public Answer.Choice choice(String name)
    • score

      public Answer.Score score(String name)
    • 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.
    • model

      public String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • answers

      public Map<String,Answer> answers()
      Returns the value of the answers record component.
      Returns:
      the value of the answers record component
    • usage

      public Usage usage()
      Returns the value of the usage record component.
      Returns:
      the value of the usage record component