Class

MLSequence

A sequence of data used as a feature input or feature output for a model.

Declaration

@interface MLSequence : NSObject

Overview

Data from sensors (a time series) or language (a series of words) are often manipulated as sequences by machine learning models. These sequences can have variable lengths depending on their context. MLSequence explicitly encodes a sequence of strings or integers to support a series of data points as a single input.

If you need to process a sequence of values individually, one at a time, see Making Predictions with a Sequence of Inputs for details.

Topics

Creating a Sequence

+ sequenceWithInt64Array:

Creates a sequence from an array of integers.

+ sequenceWithStringArray:

Creates a sequence from an array of strings.

+ emptySequenceWithType:

Creates an empty sequence of the given type.

Accessing Values

int64Values

The integer elements of the sequence.

stringValues

The string elements of the sequence.

Inspecting the Sequence

type

The type of value held in the sequence.

Relationships

Inherits From

See Also

Accessing the Value

undefined

A Boolean value indicating whether the feature value is undefined.

int64Value

The integer wrapped in this feature value.

doubleValue

The double wrapped in this feature value.

stringValue

The string wrapped in this feature value.

dictionaryValue

The dictionary wrapped in this feature value.

imageBufferValue

The image, or pixelBuffer, wrapped in this feature value.

multiArrayValue

The multidimensional array wrapped in this feature value.

MLMultiArray

A multidimensional array used as a feature input or feature output for a model.

sequenceValue

The sequence wrapped in this feature value.