ClassificationResult

public abstract class ClassificationResult

Represents the classification results of a model. Typically used as a result for classification tasks.

Public Constructors

Public Methods

abstract List<Classifications>
classifications()
The classification results for each head of the model.
static ClassificationResult
create(List<Classifications> classifications, Optional<Long> timestampMs)
Creates a ClassificationResult instance.
static ClassificationResult
createFromProto(ClassificationsProto.ClassificationResult proto)
abstract Optional<Long>
timestampMs()
The optional timestamp (in milliseconds) of the start of the chunk of data corresponding to these results.

Inherited Methods

Public Constructors

public ClassificationResult ()

Public Methods

public abstract List<Classifications> classifications ()

The classification results for each head of the model.

public static ClassificationResult create (List<Classifications> classifications, Optional<Long> timestampMs)

Creates a ClassificationResult instance.

Parameters
classifications the list of Classifications objects containing the predicted categories for each head of the model.
timestampMs the optional timestamp (in milliseconds) of the start of the chunk of data corresponding to these results.

public static ClassificationResult createFromProto (ClassificationsProto.ClassificationResult proto)

Parameters
proto the ERROR(/ClassificationsProto.ClassificationResult) protobuf message to convert.

public abstract Optional<Long> timestampMs ()

The optional timestamp (in milliseconds) of the start of the chunk of data corresponding to these results.

This is only used for classification on time series (e.g. audio classification). In these use cases, the amount of data to process might exceed the maximum size that the model can process: to solve this, the input data is split into multiple chunks starting at different timestamps.