Record Class OnnxInferenceResult

java.lang.Object
java.lang.Record
com.helix.api.ml.OnnxInferenceResult
Record Components:
modelName - Name of the evaluated model
version - Version of the evaluated model
probabilityScore - Normalized confidence or posterior probability in range [0.0, 1.0]
predictedClass - Discrete classification output (e.g., 0 for legitimate, 1 for fraud)
latencyNanos - Inference latency measured in nanoseconds
evaluatedTimestamp - Epoch milliseconds timestamp of inference execution
All Implemented Interfaces:
Serializable

public record OnnxInferenceResult(String modelName, String version, float probabilityScore, int predictedClass, long latencyNanos, long evaluatedTimestamp) extends Record implements Serializable
Encapsulates the output and performance telemetry from an in-process ONNX model evaluation.
See Also:
  • Constructor Details

    • OnnxInferenceResult

      public OnnxInferenceResult(String modelName, String version, float probabilityScore, int predictedClass, long latencyNanos, long evaluatedTimestamp)
      Canonical constructor enforcing probability bounds and non-negative latency.
  • Method Details

    • isPositive

      public boolean isPositive(float threshold)
      Evaluates if the probability score satisfies or exceeds a defined decision threshold.
      Parameters:
      threshold - classification threshold in range [0.0, 1.0]
      Returns:
      true if probability >= threshold
    • probabilityPercent

      public float probabilityPercent()
      Returns the probability score formatted as a percentage [0.0% to 100.0%].
      Returns:
      percentage probability
    • latencyMicros

      public double latencyMicros()
      Returns the inference duration in microseconds.
      Returns:
      latency in microseconds
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • modelName

      public String modelName()
      Returns the value of the modelName record component.
      Returns:
      the value of the modelName record component
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • probabilityScore

      public float probabilityScore()
      Returns the value of the probabilityScore record component.
      Returns:
      the value of the probabilityScore record component
    • predictedClass

      public int predictedClass()
      Returns the value of the predictedClass record component.
      Returns:
      the value of the predictedClass record component
    • latencyNanos

      public long latencyNanos()
      Returns the value of the latencyNanos record component.
      Returns:
      the value of the latencyNanos record component
    • evaluatedTimestamp

      public long evaluatedTimestamp()
      Returns the value of the evaluatedTimestamp record component.
      Returns:
      the value of the evaluatedTimestamp record component