Package com.helix.api.ml
Record Class OnnxInferenceResult
java.lang.Object
java.lang.Record
com.helix.api.ml.OnnxInferenceResult
- Record Components:
modelName- Name of the evaluated modelversion- Version of the evaluated modelprobabilityScore- 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 nanosecondsevaluatedTimestamp- 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 Summary
ConstructorsConstructorDescriptionOnnxInferenceResult(String modelName, String version, float probabilityScore, int predictedClass, long latencyNanos, long evaluatedTimestamp) Canonical constructor enforcing probability bounds and non-negative latency. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of theevaluatedTimestamprecord component.final inthashCode()Returns a hash code value for this object.booleanisPositive(float threshold) Evaluates if the probability score satisfies or exceeds a defined decision threshold.doubleReturns the inference duration in microseconds.longReturns the value of thelatencyNanosrecord component.Returns the value of themodelNamerecord component.intReturns the value of thepredictedClassrecord component.floatReturns the probability score formatted as a percentage [0.0% to 100.0%].floatReturns the value of theprobabilityScorerecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
modelName
Returns the value of themodelNamerecord component.- Returns:
- the value of the
modelNamerecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
probabilityScore
public float probabilityScore()Returns the value of theprobabilityScorerecord component.- Returns:
- the value of the
probabilityScorerecord component
-
predictedClass
public int predictedClass()Returns the value of thepredictedClassrecord component.- Returns:
- the value of the
predictedClassrecord component
-
latencyNanos
public long latencyNanos()Returns the value of thelatencyNanosrecord component.- Returns:
- the value of the
latencyNanosrecord component
-
evaluatedTimestamp
public long evaluatedTimestamp()Returns the value of theevaluatedTimestamprecord component.- Returns:
- the value of the
evaluatedTimestamprecord component
-