Generated from iOS SDK 27.1. Availability is shown on each declaration; permissions and entitlements still apply.
Functions and constants
method · iOS 16.0+loadRangedAnnotations
TypeScriptloadRangedAnnotations(parameters?: DataFrameTemporalAnnotationParameters<number>, continueOnFailure?: boolean): Array<AnnotatedFeature<TemporalFileSegment, number>>
Swift declarationfunc loadRangedAnnotations<Annotation>(parameters: DataFrameTemporalAnnotationParameters<Annotation> = .init(), continueOnFailure: Bool = false) throws -> [AnnotatedFeature<TemporalFileSegment, Annotation>] where Annotation : Equatable, Annotation : Sendable
Loads training examples from a data frame containing annotations.
The exact column ids within the data frame which contains the file path, annotation, startTime
and endTime of each temporal annotation, can be customized using the `parameters`
argument.
The data frame must contain at least two columns: one for file path and one for annotation.
The file path must be of String type and annotation can be of any equatable type.
The `filePath` column in the `dataFrame` should contain file path with its extension. All the files
can have absolute path or a path relative to a `baseURL`. This option can be specified using
`filePathType` in `parameters`.
The `startTime` and `endTime` columns contain the start time and end time of a temporal segment
in seconds. Their type is Double. Both the columns are optional.
If only a `startTime` is specified, it is interpreted as an annotation for the range starting from
`startTime` till the end of file, i.e., `startTime ...`.
If only an `endTime` is specified, it is interpreted as an annotation for the range starting at 0 till
`endTime`, i.e., `0 ..< endTime`.
If both `startTime` and `endTime` columns are missing or their values are missing, the annotation
is assumed to be for the entire file length.
- Note: Ensure that the same file has no overlapping range in the dataframe. Since overlapping
ranges would mean conflicting annotation for that range.
Consider an example of a dataframe containing the following values:
```
------------------------------------------------
| fileName | annotation | startTime | endTime |
| ----------|------------|-----------|---------|
| file1.wav | class1 | 0 | 4 |
| file1.wav | class2 | 5 | 10 |
| file2.wav | class1 | 2 | |
| file3.wav | class2 | | |
| file4.wav | class1 | | 5 |
------------------------------------------------
```
This will create an annotated feature list which has the following structure:
```swift
[
AnnotatedFeature(feature: TemporalFileSegment("file1.wav", 0 ..< 4), annotation: "class1"),
AnnotatedFeature(feature: TemporalFileSegment("file1.wav", 5 ..< 10), annotation: "class2"),
AnnotatedFeature(feature: TemporalFileSegment("file2.wav", 2 ...), annotation: "class1"),
AnnotatedFeature(feature: TemporalFileSegment("file3.wav", 0 ...), annotation: "class2"),
AnnotatedFeature(feature: TemporalFileSegment("file4.wav", 0 ..< 5), annotation: "class1")
]
```
- Parameters:
- parameters: Annotation parameters for using specific column names from the data frame.
By default the data frame is expected to have columns `filePath` and `annotation`.
- continueOnFailure: A Boolean value indicating whether to continue reading the dataframe
after encountering a row that is invalid. The default value is `false`.
- Returns: A list of annotated features containing `URLRange<Double>` as feature and `Annotation` as annotation.
method · iOS 16.0+selecting
TypeScriptselecting(selection: ColumnSelection): _TabularData_DataFrame
Swift declarationfunc selecting(_ selection: ColumnSelection) -> DataFrame
Generates a data frame that includes only the column selection.
- Parameter selection: A selection of columns.
- Returns: A new data frame including only the selected columns.
method · iOS 16.0+makeAsyncIterator
TypeScriptmakeAsyncIterator(): Downsampler_DownStreamSequence_Iterator<number>
Swift declarationfunc makeAsyncIterator() -> Downsampler<Input>.DownStreamSequence.Iterator
Creates the asynchronous iterator that produces elements of this
asynchronous sequence.
- Returns: An instance of the `AsyncIterator` type used to produce
elements of the asynchronous sequence.
get · iOS 16.0+count
TypeScriptget count(): (number) | null
Swift declarationvar count: Int? { get }
The count of elements.
method · iOS 16.0+next
TypeScriptnext(): Promise<(TemporalFeature<number>) | null>
Swift declarationmutating func next() async throws -> TemporalFeature<Downsampler<Input>.Output>?
Asynchronously advances to the next element and returns it, or ends the
sequence if there is no next element.
- Returns: The next element, if it exists, or `nil` to signal the end of
the sequence.
init · iOS 16.0+init
TypeScriptstatic init(factor: number): Downsampler<number>
Swift declarationinit(factor: Int)
Creates a down sample temporal transformer.
- Parameters:
- factor: The down sample factor to the input stream.
- Precondition: `factor` must be greater than 0.
get · iOS 16.0+factor
TypeScriptget factor(): number
Swift declarationlet factor: Int
The down sample factor to the input stream.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
init · iOS 16.0+init
TypeScriptstatic init(maximumAbsoluteValue: number): MaxAbsScaler_Transformer<number>
Swift declarationinit(maximumAbsoluteValue: Element)
Creates a max abs scaling transformer.
- Parameter maximumAbsoluteValue: The fitted maximum absolute value.
get · iOS 16.0+maximumAbsoluteValue
TypeScriptget maximumAbsoluteValue(): number
Swift declarationvar maximumAbsoluteValue: Element
The fitted maximum absolute value.
set · iOS 16.0+maximumAbsoluteValue
TypeScriptset maximumAbsoluteValue(value: number)
Swift declarationvar maximumAbsoluteValue: Element
The fitted maximum absolute value.
method · iOS 16.0+applied
TypeScriptapplied(input: number, eventHandler?: (((arg0: Event) => void)) | null): number
Swift declarationfunc applied(to input: Element, eventHandler: EventHandler? = nil) -> Element
Scales the input values by `1 / maximumAbsoluteValue`.
- Parameters:
- input: A floating-point value.
- eventHandler: An event handler.
- Returns: A scaled value.
method · iOS 16.0+fitted
TypeScriptfitted(input: Array<number>, eventHandler?: (((arg0: Event) => void)) | null): MaxAbsScaler_Transformer<number>
Swift declarationfunc fitted<S>(to input: S, eventHandler: EventHandler? = nil) throws -> MaxAbsScaler<Element>.Transformer where Element == S.Element, S : Sequence
Fits a max abs scaler to a sequence of elements.
- Parameters:
- input: A sequence of elements.
- eventHandler: An event handler.
- Returns: The fitted transformer.
init · iOS 16.0+init
TypeScriptstatic init(): MaxAbsScaler<number>
Swift declarationinit()
Creates a max abs scaler.
get · iOS 16.0+fittedRange
TypeScriptget fittedRange(): SDKHandle
Swift declarationvar fittedRange: ClosedRange<Element>
The fitted range derived by the estimator when fitting.
set · iOS 16.0+fittedRange
TypeScriptset fittedRange(value: SDKHandle)
Swift declarationvar fittedRange: ClosedRange<Element>
The fitted range derived by the estimator when fitting.
init · iOS 16.0+init
TypeScriptstatic init(desiredRange: SDKHandle, fittedRange: SDKHandle): MinMaxScaler_Transformer<number>
Swift declarationinit(desiredRange: ClosedRange<Element>, fittedRange: ClosedRange<Element>)
Creates a minmax scaling transformer.
- Parameters:
- desiredRange: The desired range of transformed values.
- fittedRange: The range derived by the estimator when fitting.
get · iOS 16.0+desiredRange
TypeScriptget desiredRange(): SDKHandle
Swift declarationvar desiredRange: ClosedRange<Element>
The desired range of transformed values.
set · iOS 16.0+desiredRange
TypeScriptset desiredRange(value: SDKHandle)
Swift declarationvar desiredRange: ClosedRange<Element>
The desired range of transformed values.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 16.0+applied
TypeScriptapplied(input: number, eventHandler?: (((arg0: Event) => void)) | null): number
Swift declarationfunc applied(to input: Element, eventHandler: EventHandler? = nil) -> Element
Scales the input values so that they all lie in the closed range `[minimum, maximum]`.
- Parameters:
- input: A floating-point value.
- eventHandler: An event handler.
- Returns: A scaled value.
init · iOS 16.0+init
TypeScriptstatic init(range?: SDKHandle): MinMaxScaler<number>
Swift declarationinit(range: ClosedRange<Element> = 0...1)
Creates a min max scaler.
- Parameter range: The desired range of transformed values.
get · iOS 16.0+range
TypeScriptget range(): SDKHandle
Swift declarationvar range: ClosedRange<Element>
The desired range of transformed values.
set · iOS 16.0+range
TypeScriptset range(value: SDKHandle)
Swift declarationvar range: ClosedRange<Element>
The desired range of transformed values.
method · iOS 16.0+fitted
TypeScriptfitted(input: Array<number>, eventHandler?: (((arg0: Event) => void)) | null): MinMaxScaler_Transformer<number>
Swift declarationfunc fitted<S>(to input: S, eventHandler: EventHandler? = nil) throws -> MinMaxScaler<Element>.Transformer where Element == S.Element, S : Sequence
Fits a min max scaler to a sequence of elements.
- Parameters:
- input: A sequence of elements.
- eventHandler: An event handler.
- Returns: The fitted transformer.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+interQuartileRange
TypeScriptget interQuartileRange(): number
Swift declarationvar interQuartileRange: Element
The interquartile rage used for scaling.
set · iOS 16.0+interQuartileRange
TypeScriptset interQuartileRange(value: number)
Swift declarationvar interQuartileRange: Element
The interquartile rage used for scaling.
init · iOS 16.0+init
TypeScriptstatic init(median: number, interQuartileRange: number): RobustScaler_Transformer<number>
Swift declarationinit(median: Element, interQuartileRange: Element)
Creates a robust scaling transformer.
- Parameters:
- median: The median used for offsetting.
- interQuartileRange: The inter quartile range used for scaling.
get · iOS 16.0+median
TypeScriptget median(): number
Swift declarationvar median: Element
The median used for offsetting.
set · iOS 16.0+median
TypeScriptset median(value: number)
Swift declarationvar median: Element
The median used for offsetting.
method · iOS 16.0+applied
TypeScriptapplied(input: number, eventHandler?: (((arg0: Event) => void)) | null): number
Swift declarationfunc applied(to input: Element, eventHandler: EventHandler? = nil) -> Element
Scales the input values using the calculation `(input - median) / interQuartileRange`.
- Parameters:
- input: A floating-point value.
- eventHandler: An event handler.
- Returns: A scaled value.
init · iOS 16.0+init
TypeScriptstatic init(quantileRange?: SDKHandle): RobustScaler<number>
Swift declarationinit(quantileRange: ClosedRange<Element> = 0.25...0.75)
Creates a robust scaler.
- Parameter quantileRange: This scaler removes the median and scales the data according to the quantile range.
get · iOS 16.0+quantileRange
TypeScriptget quantileRange(): SDKHandle
Swift declarationvar quantileRange: ClosedRange<Element>
The quantile range used to compute the scale.
set · iOS 16.0+quantileRange
TypeScriptset quantileRange(value: SDKHandle)
Swift declarationvar quantileRange: ClosedRange<Element>
The quantile range used to compute the scale.
method · iOS 16.0+fitted
TypeScriptfitted(input: Array<number>, eventHandler?: (((arg0: Event) => void)) | null): RobustScaler_Transformer<number>
Swift declarationfunc fitted<S>(to input: S, eventHandler: EventHandler? = nil) throws -> RobustScaler<Element>.Transformer where Element == S.Element, S : Sequence
Fits a robust scaler to a sequence of elements.
- Parameters:
- input: A sequence of elements.
- eventHandler: An event handler.
- Returns: The fitted transformer.
get · iOS 17.0+probability
TypeScriptget probability(): number
Swift declarationlet probability: Double
The probability of applying the transformer. Default value is 0.5.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): OneHotEncoder_Transformer<SDKHandle>
Swift declarationfunc makeTransformer() -> OneHotEncoder<Category>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: OneHotEncoder_Transformer<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> OneHotEncoder<Category>.Transformer
Reads the encoded transformer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: OneHotEncoder_Transformer<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: OneHotEncoder<Category>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 18.0+annotations
TypeScriptget annotations(): _CoreML_MLShapedArray<number>
Swift declarationvar annotations: MLShapedArray<Scalar>
The shaped array of annotations.
set · iOS 18.0+annotations
TypeScriptset annotations(value: _CoreML_MLShapedArray<number>)
Swift declarationvar annotations: MLShapedArray<Scalar>
The shaped array of annotations.
get · iOS 18.0+count
TypeScriptget count(): number
Swift declarationvar count: Int { get }
The number of examples in the batch.
This is the first dimension of both features and annotations.
init · iOS 18.0+init
TypeScriptstatic init(features: _CoreML_MLShapedArray<number>, annotations: _CoreML_MLShapedArray<number>): AnnotatedBatch<number>
Swift declarationinit(features: MLShapedArray<Scalar>, annotations: MLShapedArray<Scalar>)
Creates an annotated batch.
The features and annotations must have the same rank, and the first dimensions must be equal.
- Parameters:
- features: A shaped array of features.
- annotations: A shaped array of annotations.
get · iOS 18.0+features
TypeScriptget features(): _CoreML_MLShapedArray<number>
Swift declarationvar features: MLShapedArray<Scalar>
The shaped array of features.
set · iOS 18.0+features
TypeScriptset features(value: _CoreML_MLShapedArray<number>)
Swift declarationvar features: MLShapedArray<Scalar>
The shaped array of features.
get · iOS 16.0+probability
TypeScriptget probability(): number
Swift declarationvar probability: Float
The classification probability. A value between 0 and 1.
set · iOS 16.0+probability
TypeScriptset probability(value: number)
Swift declarationvar probability: Float
The classification probability. A value between 0 and 1.
init · iOS 16.0+init
TypeScriptstatic init(label: number, probability: number): Classification<number>
Swift declarationinit(label: Label, probability: Float)
Creates a classification with label and probability.
- Parameters
- label: The classification label.
- probability: The classification probability.
get · iOS 16.0+label
TypeScriptget label(): number
Swift declarationvar label: Label
The classification label.
set · iOS 16.0+label
TypeScriptset label(value: number)
Swift declarationvar label: Label
The classification label.
get · iOS 16.0+columnSelection
TypeScriptget columnSelection(): ColumnSelection
Swift declarationvar columnSelection: ColumnSelection
The column selection strategy.
set · iOS 16.0+columnSelection
TypeScriptset columnSelection(value: ColumnSelection)
Swift declarationvar columnSelection: ColumnSelection
The column selection strategy.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ColumnSelectorTransformer<unknown, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> ColumnSelector<Estimator, UnwrappedInput>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: ColumnSelectorTransformer<unknown, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: ColumnSelector<Estimator, UnwrappedInput>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+fitted
TypeScriptfitted(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<ColumnSelectorTransformer<unknown, unknown>>
Swift declarationfunc fitted(to input: DataFrame, eventHandler: EventHandler? = nil) async throws -> ColumnSelector<Estimator, UnwrappedInput>.Transformer
Fits a transformer to a data frame
- Parameters:
- input: A data frame.
- eventHandler: An event handler.
- Returns: The fitted transformer.
get · iOS 17.0+confidence
TypeScriptget confidence(): number
Swift declarationvar confidence: Float
The detection confidence. The value will always be between 0.0 and 1.0.
set · iOS 17.0+confidence
TypeScriptset confidence(value: number)
Swift declarationvar confidence: Float
The detection confidence. The value will always be between 0.0 and 1.0.
get · iOS 17.0+boundingBox
TypeScriptget boundingBox(): { x: number; y: number; width: number; height: number }
Swift declarationvar boundingBox: CGRect
The bounding box of the detected object.
set · iOS 17.0+boundingBox
TypeScriptset boundingBox(value: { x: number; y: number; width: number; height: number })
Swift declarationvar boundingBox: CGRect
The bounding box of the detected object.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): ImputeTransformer<number>
Swift declarationfunc makeTransformer() -> NumericImputer<Element>.Transformer
Creates a default-initialized impute transformer suitable for incremental fitting.
- Note: You can't use incremental fitting with an impute transformer when using the `median` strategy.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: ImputeTransformer<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> NumericImputer<Element>.Transformer
Reads the encoded transformer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: ImputeTransformer<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: NumericImputer<Element>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
init · iOS 16.0+init
TypeScriptstatic initConstant(constant: number): NumericImputer<number>
Swift declarationinit(constant: Element)
Creates an imputer with a constant value to use when replacing missing values.
get · iOS 16.0+strategy
TypeScriptget strategy(): NumericImputer_Strategy<number>
Swift declarationvar strategy: NumericImputer<Element>.Strategy
The imputation strategy.
set · iOS 16.0+strategy
TypeScriptset strategy(value: NumericImputer_Strategy<number>)
Swift declarationvar strategy: NumericImputer<Element>.Strategy
The imputation strategy.
init · iOS 16.0+init
TypeScriptstatic init(strategy: NumericImputer_Strategy<number>): NumericImputer<number>
Swift declarationinit(_ strategy: NumericImputer<Element>.Strategy)
Creates an imputer with a strategy.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): OrdinalEncoder_Transformer<SDKHandle>
Swift declarationfunc makeTransformer() -> OrdinalEncoder<Category>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: OrdinalEncoder_Transformer<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> OrdinalEncoder<Category>.Transformer
Reads the encoded transformer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: OrdinalEncoder_Transformer<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: OrdinalEncoder<Category>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 18.0+startIndex
TypeScriptget startIndex(): number
Swift declarationvar startIndex: Int { get }
The position of the first window.
method · iOS 18.0+index
TypeScriptindexAfter(i: number): number
Swift declarationfunc index(after i: Int) -> Int
Returns the position immediately after the given index.
- Parameter i: A valid index of the collection. `i` must be less than `endIndex`.
- Returns: The index value immediately after `i`.
method · iOS 18.0+index
TypeScriptindexBefore(i: number): number
Swift declarationfunc index(before i: Int) -> Int
Returns the position immediately before the given index.
- Parameter i: A valid index of the collection. `i` must be greater than `startIndex`.
- Returns: The index value immediately before `i`.
method · iOS 18.0+index
TypeScriptindexOffsetBy(i: number, distance: number): number
Swift declarationfunc index(_ i: Int, offsetBy distance: Int) -> Int
Returns an index that is the specified distance from the given index.
The value passed as `distance` must not offset `i` beyond the bounds of the collection.
- Parameters:
- i: A valid index of the collection.
- distance: The distance to offset `i`.
- Returns: An index offset by `distance` from the index `i`.
get · iOS 18.0+input
TypeScriptget input(): _CoreML_MLShapedArray<number>
Swift declarationlet input: MLShapedArray<Scalar>
The input shaped array.
init · iOS 18.0+init
TypeScriptstatic init(input: _CoreML_MLShapedArray<number>, length: number, stride?: number): SlidingWindows<number>
Swift declarationinit(input: MLShapedArray<Scalar>, length: Int, stride: Int = 1) throws
Creates a sliding windows sequence.
- Parameters:
- input: A shaped array having two dimensions.
- length: The number of samples in each window. Must be positive.
- stride: The number of samples between windows. Must be positive. Defaults to 1.
get · iOS 18.0+length
TypeScriptget length(): number
Swift declarationlet length: Int
The number samples in each window.
get · iOS 18.0+stride
TypeScriptget stride(): number
Swift declarationlet stride: Int
The number of samples between windows.
get · iOS 18.0+endIndex
TypeScriptget endIndex(): number
Swift declarationvar endIndex: Int { get }
The collection's "past the end" position–that is, the position one greater than the last valid subscript
argument.
subscript · iOS 18.0+subscript
TypeScriptsubscript(position: number): _CoreML_MLShapedArray<number>
Swift declarationsubscript(position: Int) -> MLShapedArray<Scalar> { get }
Accesses the window at the specified position.
- Parameter position: The position of the window to access. `position` must be a valid index of the
collection that is not equal to the `endIndex` property.
subscript · iOS 18.0+subscript
TypeScriptsubscript48200(bounds: SDKHandle): SDKHandle
Swift declarationsubscript(bounds: Range<Int>) -> Slice<SlidingWindows<Scalar>> { get }
Accesses a contiguous range of windows.
- Parameter bounds: A range of valid indices in the classification distribution.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+standardDeviation
TypeScriptget standardDeviation(): number
Swift declarationvar standardDeviation: Element
The standard deviation used for scaling.
set · iOS 16.0+standardDeviation
TypeScriptset standardDeviation(value: number)
Swift declarationvar standardDeviation: Element
The standard deviation used for scaling.
init · iOS 16.0+init
TypeScriptstatic init(mean: number, standardDeviation: number): StandardScaler_Transformer<number>
Swift declarationinit(mean: Element, standardDeviation: Element)
Creates a standard scaling transformer.
- Parameters:
- mean: The mean used for offsetting.
- standardDeviation: The standard deviation used for scaling.
get · iOS 16.0+mean
TypeScriptget mean(): number
Swift declarationvar mean: Element
The mean used for offsetting.
set · iOS 16.0+mean
TypeScriptset mean(value: number)
Swift declarationvar mean: Element
The mean used for offsetting.
method · iOS 16.0+applied
TypeScriptapplied(input: number, eventHandler?: (((arg0: Event) => void)) | null): number
Swift declarationfunc applied(to input: Element, eventHandler: EventHandler? = nil) -> Element
Scales the input values using the calculation `(input - mean) / standardDeviation`.
- Parameters:
- input: A floating-point value.
- eventHandler: An event handler.
- Returns: A scaled value.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): StandardScaler_Transformer<number>
Swift declarationfunc makeTransformer() -> StandardScaler<Element>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: StandardScaler_Transformer<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> StandardScaler<Element>.Transformer
Reads the encoded transformer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: StandardScaler_Transformer<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: StandardScaler<Element>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+fitted
TypeScriptfitted(input: Array<number>, eventHandler?: (((arg0: Event) => void)) | null): StandardScaler_Transformer<number>
Swift declarationfunc fitted<S>(to input: S, eventHandler: EventHandler? = nil) throws -> StandardScaler<Element>.Transformer where Element == S.Element, S : Sequence
Fits a transformer to a particular input sequence by computing the mean and standard deviation.
init · iOS 16.0+init
TypeScriptstatic init(): StandardScaler<number>
Swift declarationinit()
Creates a standard scaling estimator.
get · iOS 17.0+scaleFeatures
TypeScriptget scaleFeatures(): boolean
Swift declarationvar scaleFeatures: Bool
A Boolean value indicating whether to scale the input features.
Scaling the features reduces numerical errors.
set · iOS 17.0+scaleFeatures
TypeScriptset scaleFeatures(value: boolean)
Swift declarationvar scaleFeatures: Bool
A Boolean value indicating whether to scale the input features.
Scaling the features reduces numerical errors.
get · iOS 16.0+maximumIterations
TypeScriptget maximumIterations(): number
Swift declarationvar maximumIterations: Int
The maximum number of allowed passes through the data.
More passes over the data can result in a more accurately trained model. Consider increasing this if the
training accuracy is low. Defaults to 25.
- Note: This parameter is only used by the `fitted` method. When using the `update` method it's up to you
to decide when to stop.
set · iOS 16.0+maximumIterations
TypeScriptset maximumIterations(value: number)
Swift declarationvar maximumIterations: Int
The maximum number of allowed passes through the data.
More passes over the data can result in a more accurately trained model. Consider increasing this if the
training accuracy is low. Defaults to 25.
- Note: This parameter is only used by the `fitted` method. When using the `update` method it's up to you
to decide when to stop.
get · iOS 16.0+convergenceThreshold
TypeScriptget convergenceThreshold(): number
Swift declarationvar convergenceThreshold: Double
The convergence threshold.
When the residual is within the convergence threshold of the objective, training stops. The threshold is
also used by the `fitted` method to decide when progress is no longer being made, in which case the
training process will stop before convergence and before the specified maximum number of iterations (known
as early stopping).
Consider reducing this value for a more accurately trained model. But beware of overfitting if the it is
set to a very low value. Defaults to 0.01.
set · iOS 16.0+convergenceThreshold
TypeScriptset convergenceThreshold(value: number)
Swift declarationvar convergenceThreshold: Double
The convergence threshold.
When the residual is within the convergence threshold of the objective, training stops. The threshold is
also used by the `fitted` method to decide when progress is no longer being made, in which case the
training process will stop before convergence and before the specified maximum number of iterations (known
as early stopping).
Consider reducing this value for a more accurately trained model. But beware of overfitting if the it is
set to a very low value. Defaults to 0.01.
get · iOS 17.0+optimizationStrategy
TypeScriptget optimizationStrategy(): OptimizationStrategy
Swift declarationvar optimizationStrategy: OptimizationStrategy { get set }
The optimization strategy.
set · iOS 17.0+optimizationStrategy
TypeScriptset optimizationStrategy(value: OptimizationStrategy)
Swift declarationvar optimizationStrategy: OptimizationStrategy { get set }
The optimization strategy.
get · iOS 17.0+earlyStopIterationCount
TypeScriptget earlyStopIterationCount(): number
Swift declarationvar earlyStopIterationCount: Int
The number of iterations to use when evaluating whether to stop early.
The `fitted` method will stop if no significant progress is made for this many iterations. Significant
progress happens when the validation error decreases by at least `convergenceThreshold`.
- Note: Early stopping only happens when using the `fitted` method with validation data.
set · iOS 17.0+earlyStopIterationCount
TypeScriptset earlyStopIterationCount(value: number)
Swift declarationvar earlyStopIterationCount: Int
The number of iterations to use when evaluating whether to stop early.
The `fitted` method will stop if no significant progress is made for this many iterations. Significant
progress happens when the validation error decreases by at least `convergenceThreshold`.
- Note: Early stopping only happens when using the `fitted` method with validation data.
get · iOS 16.0+stepSize
TypeScriptget stepSize(): number
Swift declarationvar stepSize: Double
The starting step size to use for the solver.
Defaults to 1.0. If the first iteration takes a considerable amount of time, reducing this parameter may speed
up model training.
set · iOS 16.0+stepSize
TypeScriptset stepSize(value: number)
Swift declarationvar stepSize: Double
The starting step size to use for the solver.
Defaults to 1.0. If the first iteration takes a considerable amount of time, reducing this parameter may speed
up model training.
get · iOS 16.0+l1Penalty
TypeScriptget l1Penalty(): number
Swift declarationvar l1Penalty: Double
Weight of the L1 regularization term.
Like the l2 penalty, the higher the l1 penalty, the more the estimated coefficients shrink toward 0. The l1
penalty, however, completely zeros out sufficiently small coefficients, automatically indicating features that
are not useful for the model. The default weight of 0 prevents any features from being discarded.
set · iOS 16.0+l1Penalty
TypeScriptset l1Penalty(value: number)
Swift declarationvar l1Penalty: Double
Weight of the L1 regularization term.
Like the l2 penalty, the higher the l1 penalty, the more the estimated coefficients shrink toward 0. The l1
penalty, however, completely zeros out sufficiently small coefficients, automatically indicating features that
are not useful for the model. The default weight of 0 prevents any features from being discarded.
get · iOS 16.0+l2Penalty
TypeScriptget l2Penalty(): number
Swift declarationvar l2Penalty: Double
Weight of the L2 regularization term.
The larger this weight, the more the model coefficients shrink toward 0. This introduces bias into the model
but decreases variance, potentially leading to better predictions. The default value is 0.01; setting this
parameter to 0 corresponds to unregularized logistic regression.
set · iOS 16.0+l2Penalty
TypeScriptset l2Penalty(value: number)
Swift declarationvar l2Penalty: Double
Weight of the L2 regularization term.
The larger this weight, the more the model coefficients shrink toward 0. This introduces bias into the model
but decreases variance, potentially leading to better predictions. The default value is 0.01; setting this
parameter to 0 corresponds to unregularized logistic regression.
init · iOS 16.0+init
TypeScriptstatic init(): LinearRegressor_Configuration<number>
Swift declarationinit()
Creates a default linear regressor configuration.
get · iOS 16.0+configuration
TypeScriptget configuration(): LinearRegressor_Configuration<number>
Swift declarationvar configuration: LinearRegressor<Scalar>.Configuration { get set }
The linear regressor configuration.
set · iOS 16.0+configuration
TypeScriptset configuration(value: LinearRegressor_Configuration<number>)
Swift declarationvar configuration: LinearRegressor<Scalar>.Configuration { get set }
The linear regressor configuration.
init · iOS 16.0+init
TypeScriptstatic init(configuration?: LinearRegressor_Configuration<number>): LinearRegressor<number>
Swift declarationinit(configuration: LinearRegressor<Scalar>.Configuration = Configuration())
Creates a linear regressor.
- Parameter configuration: The configuration.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): LinearRegressorModel<number>
Swift declarationfunc makeTransformer() -> LinearRegressorModel<Scalar>
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: LinearRegressorModel<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> LinearRegressorModel<Scalar>
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: LinearRegressorModel<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: LinearRegressorModel<Scalar>, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: LinearRegressorModel<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> LinearRegressorModel<Scalar>
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: LinearRegressorModel<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: LinearRegressorModel<Scalar>, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+fitted
TypeScriptfittedToValidateOnEventHandler(input: Array<AnnotatedFeature<SDKHandle, number>>, validation: Array<AnnotatedFeature<SDKHandle, number>>, eventHandler?: (((arg0: Event) => void)) | null): Promise<LinearRegressorModel<number>>
Swift declarationfunc fitted<Input, Validation>(to input: Input, validateOn validation: Validation, eventHandler: EventHandler? = nil) async throws -> LinearRegressorModel<Scalar> where Input : Sequence, Validation : Sequence, Input.Element == AnnotatedFeature<MLShapedArray<Scalar>, Scalar>, Validation.Element == AnnotatedFeature<MLShapedArray<Scalar>, Scalar>
Fits a linear regressor model to a sequence of examples.
- Parameters:
- input: A sequence of examples used for fitting the regressor.
- validation: A sequence of examples used for validating the fitted regressor.
- eventHandler: An event handler. This method reports maximum error and root-mean-square error metrics.
- Returns: The fitted linear regressor model.
method · iOS 16.0+fitted
TypeScriptfittedToEventHandler(input: Array<AnnotatedFeature<SDKHandle, number>>, eventHandler?: (((arg0: Event) => void)) | null): Promise<LinearRegressorModel<number>>
Swift declarationfunc fitted<Input>(to input: Input, eventHandler: EventHandler? = nil) async throws -> LinearRegressorModel<Scalar> where Input : Sequence, Input.Element == AnnotatedFeature<MLShapedArray<Scalar>, Scalar>
Fits a linear regressor model to a sequence of examples.
- Parameters:
- input: A sequence of examples used for fitting the regressor.
- eventHandler: An event handler. This method reports maximum error and root-mean-square error metrics.
- Returns: The fitted linear regressor model.
method · iOS 17.0+update
TypeScriptupdate(transformer: LinearRegressorModel<number>, input: Array<AnnotatedFeature<SDKHandle, number>>, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": LinearRegressorModel<number> } }>
Swift declarationfunc update<InputSequence>(_ transformer: inout LinearRegressor<Scalar>.Transformer, with input: InputSequence, eventHandler: EventHandler?) async throws where InputSequence : Sequence, InputSequence.Element == AnnotatedFeature<MLShapedArray<Scalar>, Scalar>
Updates a transformer with a new sequence of examples.
- Parameters:
- transformer: A transformer to update.
- input: A sequence of examples.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
init · iOS 16.0+init
TypeScriptstatic init(id: TemporalSegmentIdentifier, feature: unknown): TemporalFeature<unknown>
Swift declarationinit(id: TemporalSegmentIdentifier, feature: Feature)
Creates a temporal feature.
- Parameters:
- id: The temporal segment identifier.
- feature: The feature value.
get · iOS 16.0+id
TypeScriptget id(): TemporalSegmentIdentifier
Swift declarationvar id: TemporalSegmentIdentifier
The temporal segment identifier for this feature.
set · iOS 16.0+id
TypeScriptset id(value: TemporalSegmentIdentifier)
Swift declarationvar id: TemporalSegmentIdentifier
The temporal segment identifier for this feature.
get · iOS 16.0+feature
TypeScriptget feature(): unknown
Swift declarationvar feature: Feature
The feature value.
set · iOS 16.0+feature
TypeScriptset feature(value: unknown)
Swift declarationvar feature: Feature
The feature value.
get · iOS 16.0+annotation
TypeScriptget annotation(): unknown
Swift declarationvar annotation: Annotation
The annotation.
set · iOS 16.0+annotation
TypeScriptset annotation(value: unknown)
Swift declarationvar annotation: Annotation
The annotation.
init · iOS 16.0+init
TypeScriptstatic init(feature: unknown, annotation: unknown): AnnotatedFeature<unknown, unknown>
Swift declarationinit(feature: Feature, annotation: Annotation)
Creates an example with a feature and an annotation.
get · iOS 16.0+feature
TypeScriptget feature(): unknown
Swift declarationvar feature: Feature
The feature value.
set · iOS 16.0+feature
TypeScriptset feature(value: unknown)
Swift declarationvar feature: Feature
The feature value.
function · iOS 17.0+meanSquaredError
TypeScriptmeanSquaredError(annotatedPredictions: Array<AnnotatedPrediction<number, number>>): number
Swift declaration@backDeployed(before: macOS 15.0, iOS 18.0, tvOS 18.0, visionOS 2.0)
func meanSquaredError<T>(_ annotatedPredictions: [AnnotatedPrediction<T, T>]) -> T where T : FloatingPoint
Computes the root mean squared error between predicted and ground truth values.
If an empty `AnnotatedPrediction` is supplied, the result will be NaN.
- Parameters:
- annotatedPredictions: An `AnnotatedPrediction` object.
- Returns: The root mean squared error.
get · iOS 17.0+probability
TypeScriptget probability(): number
Swift declarationlet probability: Double
The probability of applying each transformer. Default value is 0.5.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
init · iOS 16.0+init
TypeScriptstatic init(value: number): ImputeTransformer<number>
Swift declarationinit(value: Element)
Creates an impute transformer.
- Parameter value: The value used to replace missing values.
get · iOS 16.0+value
TypeScriptget value(): number
Swift declarationvar value: Element
Impute value used to replace missing values.
set · iOS 16.0+value
TypeScriptset value(value: number)
Swift declarationvar value: Element
Impute value used to replace missing values.
method · iOS 16.0+applied
TypeScriptapplied(input?: (number) | null, eventHandler?: (((arg0: Event) => void)) | null): number
Swift declarationfunc applied(to input: Element?, eventHandler: EventHandler? = nil) -> Element
Imputes a single input.
- Parameters:
- input: The input.
- eventHandler: An event handler.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
init · iOS 16.0+init
TypeScriptstatic init(scale: number, offset: number): LinearTransformer<number>
Swift declarationinit(scale: Element, offset: Element)
Creates a linear transformer.
- Parameters:
- scale: The amount to be scaled.
- offset: The amount to be offset after scaling.
get · iOS 16.0+scale
TypeScriptget scale(): number
Swift declarationvar scale: Element
The amount to be scaled.
set · iOS 16.0+scale
TypeScriptset scale(value: number)
Swift declarationvar scale: Element
The amount to be scaled.
get · iOS 16.0+offset
TypeScriptget offset(): number
Swift declarationvar offset: Element
The amount to be offset after scaling.
set · iOS 16.0+offset
TypeScriptset offset(value: number)
Swift declarationvar offset: Element
The amount to be offset after scaling.
method · iOS 16.0+applied
TypeScriptappliedToEventHandler(input: Array<number>, eventHandler?: (((arg0: Event) => void)) | null): Array<number>
Swift declarationfunc applied<S>(to input: S, eventHandler: EventHandler? = nil) -> [Element] where Element == S.Element, S : Sequence
Scales a sequence of inputs.
- Parameters:
- input: A sequence of input values.
- eventHandler: An event handler.
- Returns: An array of scaled values.
method · iOS 16.0+applied
TypeScriptappliedToEventHandler7721(input: number, eventHandler?: (((arg0: Event) => void)) | null): number
Swift declarationfunc applied(to input: Element, eventHandler: EventHandler? = nil) -> Element
Scales an input.
- Parameters:
- input: A floating-point value.
- eventHandler: An event handler.
- Returns: A scaled value.
method · iOS 16.0+applied
TypeScriptapplied(input?: (unknown) | null, eventHandler?: (((arg0: Event) => void)) | null): unknown
Swift declarationfunc applied(to input: Element?, eventHandler: EventHandler? = nil) throws -> Element
Unwraps an optional element or throws if the value is `nil`.
- Parameters:
- input: The optional input.
- eventHandler: An event handler.
- Returns: The unwrapped value.
- Throws: `MissingValueError` if the input is `nil`.
init · iOS 16.0+init
TypeScriptstatic init(): OptionalUnwrapper<unknown>
Swift declarationinit()
Creates a transformer that unwraps an optional element or throws if the value is nil.
function · iOS 17.0+meanAbsoluteError
TypeScriptmeanAbsoluteError(annotatedPredictions: Array<AnnotatedPrediction<number, number>>): number
Swift declarationfunc meanAbsoluteError<T>(_ annotatedPredictions: [AnnotatedPrediction<T, T>]) -> T where T : FloatingPoint
Computes the mean absolute error between predicted and ground truth values.
If an empty `AnnotatedPrediction` is supplied, the result will be NaN.
- Parameters:
- annotatedPredictions: An `AnnotatedPrediction` object.
- Returns: The mean absolute error.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
init · iOS 16.0+init
TypeScriptstatic initConstant(constant: number): CategoricalImputer<number>
Swift declarationinit(constant: Element)
Creates an imputer with a constant value to use when replacing missing values.
get · iOS 16.0+strategy
TypeScriptget strategy(): CategoricalImputer_Strategy<number>
Swift declarationvar strategy: CategoricalImputer<Element>.Strategy
The imputation strategy.
set · iOS 16.0+strategy
TypeScriptset strategy(value: CategoricalImputer_Strategy<number>)
Swift declarationvar strategy: CategoricalImputer<Element>.Strategy
The imputation strategy.
init · iOS 16.0+init
TypeScriptstatic init(strategy: CategoricalImputer_Strategy<number>): CategoricalImputer<number>
Swift declarationinit(_ strategy: CategoricalImputer<Element>.Strategy)
Creates an imputer with a strategy.
get · iOS 16.0+concatenatedColumnName
TypeScriptget concatenatedColumnName(): string
Swift declarationvar concatenatedColumnName: String
The name of the concatenated column containing the shaped arrays.
set · iOS 16.0+concatenatedColumnName
TypeScriptset concatenatedColumnName(value: string)
Swift declarationvar concatenatedColumnName: String
The name of the concatenated column containing the shaped arrays.
init · iOS 16.0+init
TypeScriptstatic init(columnSelection?: ColumnSelection, concatenatedColumnName?: string): ColumnConcatenator<number>
Swift declarationinit(columnSelection: ColumnSelection = .all, concatenatedColumnName: String = "features")
Creates a concatenator that concatenates numeric columns into a new column of ML shaped array.
- Parameters:
- columnSelection: A selection of columns to concatenate.
- concatenatedColumnName: The name of the resulting shaped array column.
get · iOS 16.0+columnSelection
TypeScriptget columnSelection(): ColumnSelection
Swift declarationvar columnSelection: ColumnSelection
The selection of columns to concatenate.
set · iOS 16.0+columnSelection
TypeScriptset columnSelection(value: ColumnSelection)
Swift declarationvar columnSelection: ColumnSelection
The selection of columns to concatenate.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 16.0+applied
TypeScriptapplied(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): _TabularData_DataFrame
Swift declarationfunc applied(to input: DataFrame, eventHandler: EventHandler? = nil) throws -> DataFrame
Combines every numerical column in a data frame into to a shaped array for each row.
get · iOS 17.0+annotation
TypeScriptget annotation(): unknown
Swift declarationvar annotation: Annotation
The ground truth annotation.
set · iOS 17.0+annotation
TypeScriptset annotation(value: unknown)
Swift declarationvar annotation: Annotation
The ground truth annotation.
init · iOS 17.0+init
TypeScriptstatic init(prediction: unknown, annotation: unknown): AnnotatedPrediction<unknown, unknown>
Swift declarationinit(prediction: Prediction, annotation: Annotation)
Creates an annotated preditction.
get · iOS 17.0+prediction
TypeScriptget prediction(): unknown
Swift declarationvar prediction: Prediction
The predicted value.
set · iOS 17.0+prediction
TypeScriptset prediction(value: unknown)
Swift declarationvar prediction: Prediction
The predicted value.
method · iOS 16.0+next
TypeScriptnext(): Promise<(unknown) | null>
Swift declarationfunc next() async throws -> Element?
Asynchronously advances to the next element and returns it, or ends the
sequence if there is no next element.
- Returns: The next element, if it exists, or `nil` to signal the end of
the sequence.
method · iOS 16.0+makeAsyncIterator
TypeScriptmakeAsyncIterator(): AnyTemporalIterator<TemporalFeature<unknown>>
Swift declarationfunc makeAsyncIterator() -> AnyTemporalIterator<AnyTemporalSequence<Feature>.Element>
Creates the asynchronous iterator that produces elements of this
asynchronous sequence.
- Returns: An instance of the `AsyncIterator` type used to produce
elements of the asynchronous sequence.
get · iOS 16.0+count
TypeScriptget count(): (number) | null
Swift declarationlet count: Int?
The number of elements in the sequence if available, calculated nondestructively.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 16.0+applied
TypeScriptapplied(input: SDKHandle, eventHandler?: (((arg0: Event) => void)) | null): Promise<SDKHandle>
Swift declarationfunc applied(to input: ComposedTransformer<Inner, Outer>.Input, eventHandler: EventHandler? = nil) async throws -> ComposedTransformer<Inner, Outer>.Output
Performs the composed transformation on a single input.
- Parameters:
- input: The transformer input.
- eventHandler: An event handler.
- Returns: An output produced by applying the transformer to the input.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
init · iOS 16.0+init
TypeScriptstatic init(scale: number): NormalizationScaler_Transformer<number>
Swift declarationinit(scale: Element)
Creates a normalization scaling transformer.
- Parameter scale: The normalization scale.
get · iOS 16.0+scale
TypeScriptget scale(): number
Swift declarationvar scale: Element
The normalization scale used to scale the input.
set · iOS 16.0+scale
TypeScriptset scale(value: number)
Swift declarationvar scale: Element
The normalization scale used to scale the input.
method · iOS 16.0+applied
TypeScriptapplied(input: number, eventHandler?: (((arg0: Event) => void)) | null): number
Swift declarationfunc applied(to input: Element, eventHandler: EventHandler? = nil) -> Element
Scales the input values using the calculation `input / scale`.
- Parameters:
- input: A floating-point value.
- eventHandler: An event handler.
- Returns: A scaled value.
get · iOS 16.0+norm
TypeScriptget norm(): NormalizationScaler_NormalizationStrategy<number>
Swift declarationvar norm: NormalizationScaler<Element>.NormalizationStrategy
The normalization strategy.
set · iOS 16.0+norm
TypeScriptset norm(value: NormalizationScaler_NormalizationStrategy<number>)
Swift declarationvar norm: NormalizationScaler<Element>.NormalizationStrategy
The normalization strategy.
init · iOS 16.0+init
TypeScriptstatic init(norm?: NormalizationScaler_NormalizationStrategy<number>): NormalizationScaler<number>
Swift declarationinit(norm: NormalizationScaler<Element>.NormalizationStrategy = .l2)
Creates a normalization scaler.
- Parameter norm: A selected NormalizationStrategy to scale by. Defaults as `l2`.
method · iOS 16.0+fitted
TypeScriptfitted(input: Array<number>, eventHandler?: (((arg0: Event) => void)) | null): NormalizationScaler_Transformer<number>
Swift declarationfunc fitted<S>(to input: S, eventHandler: EventHandler? = nil) throws -> NormalizationScaler<Element>.Transformer where Element == S.Element, S : Sequence
Fits a normalization scaler to a sequence of elements.
- Parameters:
- input: A sequence of elements.
- eventHandler: An event handler.
- Returns: The fitted transformer.
get · iOS 17.0+classCount
TypeScriptget classCount(): number
Swift declarationvar classCount: Int { get }
The number of classes.
method · iOS 16.0+buildDataFrame
TypeScriptbuildDataFrame(distributions: Array<ClassificationDistribution<number>>): _TabularData_DataFrame
Swift declarationfunc buildDataFrame(_ distributions: [ClassificationDistribution<Label>]) -> DataFrame
Builds a data frame containing a labels column and a probability distribution column.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 17.0+featureColumnNames
TypeScriptget featureColumnNames(): Array<string>
Swift declarationvar featureColumnNames: [String] { get }
The names of the columns containing feature values.
get · iOS 17.0+predictionColumnName
TypeScriptget predictionColumnName(): string
Swift declarationvar predictionColumnName: String
The name of the column containing the predicted labels.
set · iOS 17.0+predictionColumnName
TypeScriptset predictionColumnName(value: string)
Swift declarationvar predictionColumnName: String
The name of the column containing the predicted labels.
method · iOS 16.0+applied
TypeScriptapplied(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<_TabularData_DataFrame>
Swift declarationfunc applied(to input: DataFrame, eventHandler: EventHandler? = nil) async throws -> DataFrame
Performs a classification on a data frame.
- Parameters:
- input: The input data frame.
- eventHandler: An event handler.
- Returns: A data frame of classifications.
get · iOS 17.0+transformer
TypeScriptget transformer(): RandomImageCropper
Swift declarationvar transformer: RandomTransformer
The transformation applied to each element.
set · iOS 17.0+transformer
TypeScriptset transformer(value: RandomImageCropper)
Swift declarationvar transformer: RandomTransformer
The transformation applied to each element.
get · iOS 16.0+configuration
TypeScriptget configuration(): BoostedTreeConfiguration
Swift declarationvar configuration: BoostedTreeConfiguration { get set }
Boosted tree configuration.
set · iOS 16.0+configuration
TypeScriptset configuration(value: BoostedTreeConfiguration)
Swift declarationvar configuration: BoostedTreeConfiguration { get set }
Boosted tree configuration.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): TreeRegressorModel
Swift declarationfunc makeTransformer() -> TreeRegressorModel
Creates a default-initialized transformer suitable for incremental fitting.
get · iOS 16.0+annotationColumnID
TypeScriptget annotationColumnID(): _TabularData_ColumnID<unknown>
Swift declarationvar annotationColumnID: ColumnID<Annotation>
The annotation column identifier.
set · iOS 16.0+annotationColumnID
TypeScriptset annotationColumnID(value: _TabularData_ColumnID<unknown>)
Swift declarationvar annotationColumnID: ColumnID<Annotation>
The annotation column identifier.
get · iOS 16.0+featureColumnNames
TypeScriptget featureColumnNames(): Array<string>
Swift declarationvar featureColumnNames: [String]
The names of the columns containing feature values.
set · iOS 16.0+featureColumnNames
TypeScriptset featureColumnNames(value: Array<string>)
Swift declarationvar featureColumnNames: [String]
The names of the columns containing feature values.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: TreeRegressorModel; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> TreeRegressorModel
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: TreeRegressorModel, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: TreeRegressorModel, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
init · iOS 16.0+init
TypeScriptstatic init(annotationColumnName: string, featureColumnNames: Array<string>, configuration?: BoostedTreeConfiguration): BoostedTreeRegressor<unknown>
Swift declarationinit(annotationColumnName: String, featureColumnNames: [String], configuration: BoostedTreeConfiguration = BoostedTreeConfiguration())
Creates a boosted tree regressor.
- Parameters
- annotationColumnName: The name of the column containing the ground truth values.
- featureColumnNames: The names of the feature columns.
- configuration: The configuration.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: TreeRegressorModel; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> TreeRegressorModel
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: TreeRegressorModel, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: TreeRegressorModel, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+fitted
TypeScriptfitted(input: _TabularData_DataFrame, validation?: (_TabularData_DataFrame) | null, eventHandler?: (((arg0: Event) => void)) | null): Promise<TreeRegressorModel>
Swift declarationfunc fitted(to input: DataFrame, validateOn validation: DataFrame? = nil, eventHandler: EventHandler? = nil) async throws -> TreeRegressorModel
Fits a boosted tree regressor model to a collection of examples.
- Parameters:
- input: A data frame containing examples used for fitting the transformer.
- validation: A data frame containing examples used for validating the fitted transformer.
- eventHandler: An event handler. This method reports maximum error and root-mean-square error metrics.
- Returns: The fitted boosted tree regressor model.
method · iOS 17.0+update
TypeScriptupdate(transformer: TreeRegressorModel, input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": TreeRegressorModel } }>
Swift declarationfunc update(_ transformer: inout TreeRegressorModel, with input: DataFrame, eventHandler: EventHandler?) async throws
Updates a transformer with a new sequence of examples.
- Parameters:
- transformer: A transformer to update.
- input: A data frame containing examples.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
method · iOS 18.0+applied
TypeScriptapplied(date: globalThis.Date, eventHandler?: (((arg0: Event) => void)) | null): Array<number>
Swift declarationfunc applied(to date: Date, eventHandler: EventHandler? = nil) -> [Scalar]
Extracts features of a particular date.
- Parameters:
- date: The date.
- eventHandler: An event handler.
- Returns: An array of feature values.
get · iOS 18.0+calendar
TypeScriptget calendar(): _Foundation_Calendar
Swift declarationlet calendar: Calendar
The calendar.
init · iOS 18.0+init
TypeScriptstatic init(features: DateFeatures, calendar?: _Foundation_Calendar): DateFeatureExtractor<number>
Swift declarationinit(features: DateFeatures, calendar: Calendar = Calendar.current)
Creates a date feature extractor.
- Parameters:
- calendar: The calendar to use, defaults to `Calendar.current`.
- features: The date and time features.
get · iOS 18.0+features
TypeScriptget features(): DateFeatures
Swift declarationlet features: DateFeatures
The date and time features.
get · iOS 17.0+coefficients
TypeScriptget coefficients(): Array<number>
Swift declarationvar coefficients: [Scalar] { get }
The linear coefficients.
get · iOS 17.0+featureCount
TypeScriptget featureCount(): number
Swift declarationvar featureCount: Int { get }
The number of features expected in the input.
method · iOS 16.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<number>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> Scalar
Performs a regression on a single input.
- Parameters:
- input: The regressor input.
- eventHandler: An event handler.
- Returns: A regression.
get · iOS 18.0+configuration
TypeScriptget configuration(): TimeSeriesClassifierConfiguration
Swift declarationvar configuration: TimeSeriesClassifierConfiguration
The configuration.
set · iOS 18.0+configuration
TypeScriptset configuration(value: TimeSeriesClassifierConfiguration)
Swift declarationvar configuration: TimeSeriesClassifierConfiguration
The configuration.
method · iOS 18.0+makeTransformer
TypeScriptmakeTransformer(): TimeSeriesClassifier_Model<number, SDKHandle>
Swift declarationfunc makeTransformer() -> TimeSeriesClassifier<Scalar, Label>.Model
Creates a default-initialized model suitable for incremental fitting.
method · iOS 18.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: TimeSeriesClassifier_Model<number, SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> TimeSeriesClassifier<Scalar, Label>.Transformer
Reads the encoded model and optimizer with a decoder.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 18.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: TimeSeriesClassifier_Model<number, SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: TimeSeriesClassifier<Scalar, Label>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the model and optimizer to an encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 18.0+export
TypeScriptexportToMetadata(url: string, metadata: ModelMetadata): void
Swift declarationfunc export(to url: URL, metadata: ModelMetadata) throws
Exports this transformer as a CoreML model package with user-supplied metadata.
- Parameters:
- url: The location to write the model into.
- metadata: Contextual user-provided information.
method · iOS 18.0+export
TypeScriptexportTo(url: string): void
Swift declarationfunc export(to url: URL) throws
Exports this transformer as a CoreML model package.
- Parameter url: The location to write the model into.
get · iOS 18.0+stride
TypeScriptget stride(): number
Swift declarationvar stride: Int
The number of samples between temporal predictions.
set · iOS 18.0+stride
TypeScriptset stride(value: number)
Swift declarationvar stride: Int
The number of samples between temporal predictions.
method · iOS 18.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<ClassificationDistribution<SDKHandle>>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> ClassificationDistribution<Label>
Performs a classification on a shaped array of input features.
- Parameters:
- input: A shaped array of input features. The shape must `[sequenceLength, featureSize]`.
- eventHandler: An event handler.
- Returns: A classification distribution.
function · iOS 17.0+maximumAbsoluteError
TypeScriptmaximumAbsoluteError(annotatedPredictions: Array<AnnotatedPrediction<number, number>>): number
Swift declarationfunc maximumAbsoluteError<T>(_ annotatedPredictions: [AnnotatedPrediction<T, T>]) -> T where T : FloatingPoint
Computes the maximum absolute error between predicted and ground truth values.
If an empty `AnnotatedPrediction` is supplied, the result will be NaN.
- Parameters:
- annotatedPredictions: An `AnnotatedPrediction` object.
- Returns: The maximum absolute error.
function · iOS 17.0+rootMeanSquaredError
TypeScriptrootMeanSquaredError(annotatedPredictions: Array<AnnotatedPrediction<number, number>>): number
Swift declarationfunc rootMeanSquaredError<T>(_ annotatedPredictions: [AnnotatedPrediction<T, T>]) -> T where T : FloatingPoint
Computes the root mean squared error between predicted and ground truth values.
If an empty `AnnotatedPrediction` is supplied, the result will be NaN.
- Parameters:
- annotatedPredictions: An `AnnotatedPrediction` object.
- Returns: The root mean squared error.
get · iOS 16.0+configuration
TypeScriptget configuration(): BoostedTreeConfiguration
Swift declarationvar configuration: BoostedTreeConfiguration { get set }
Boosted tree configuration.
set · iOS 16.0+configuration
TypeScriptset configuration(value: BoostedTreeConfiguration)
Swift declarationvar configuration: BoostedTreeConfiguration { get set }
Boosted tree configuration.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): TreeClassifierModel<SDKHandle>
Swift declarationfunc makeTransformer() -> TreeClassifierModel<Label>
Creates a default-initialized transformer suitable for incremental fitting.
get · iOS 16.0+annotationColumnID
TypeScriptget annotationColumnID(): _TabularData_ColumnID<SDKHandle>
Swift declarationvar annotationColumnID: ColumnID<Label>
The annotation column identifier.
set · iOS 16.0+annotationColumnID
TypeScriptset annotationColumnID(value: _TabularData_ColumnID<SDKHandle>)
Swift declarationvar annotationColumnID: ColumnID<Label>
The annotation column identifier.
get · iOS 16.0+featureColumnNames
TypeScriptget featureColumnNames(): Array<string>
Swift declarationvar featureColumnNames: [String]
The names of the columns containing feature values.
set · iOS 16.0+featureColumnNames
TypeScriptset featureColumnNames(value: Array<string>)
Swift declarationvar featureColumnNames: [String]
The names of the columns containing feature values.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: TreeClassifierModel<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> TreeClassifierModel<Label>
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: TreeClassifierModel<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: TreeClassifierModel<Label>, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: TreeClassifierModel<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> TreeClassifierModel<Label>
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: TreeClassifierModel<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: TreeClassifierModel<Label>, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+fitted
TypeScriptfitted(input: _TabularData_DataFrame, validation?: (_TabularData_DataFrame) | null, eventHandler?: (((arg0: Event) => void)) | null): Promise<TreeClassifierModel<SDKHandle>>
Swift declarationfunc fitted(to input: DataFrame, validateOn validation: DataFrame? = nil, eventHandler: EventHandler? = nil) async throws -> TreeClassifierModel<Label>
Fits a boosted tree classifier model to a collection of examples.
- Parameters:
- input: A data frame of examples.
- validation: A data frame of validation examples.
- eventHandler: An event handler. This method reports accuracy and loss metrics.
- Returns: The fitted boosted tree classifier model.
method · iOS 17.0+update
TypeScriptupdate(transformer: TreeClassifierModel<SDKHandle>, input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": TreeClassifierModel<SDKHandle> } }>
Swift declarationfunc update(_ transformer: inout TreeClassifierModel<Label>, with input: DataFrame, eventHandler: EventHandler?) async throws
Updates a transformer with a new sequence of examples.
- Parameters:
- transformer: A transformer to update.
- input: A data frame containing examples.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
method · iOS 16.0+recallScore
TypeScriptrecallScore(label: number): number
Swift declarationfunc recallScore(label: Label) -> Double
Computes the recall score for a class label.
Precision score is computed as the ratio `tp / (tp + fn)` where `tp` is the number of true positives and `fn`
is the number of false negatives.
- Parameter label: The label to use as true positive.
- Returns: The recall score for the given label.
get · iOS 17.0+exampleCount
TypeScriptget exampleCount(): number
Swift declarationvar exampleCount: Int { get }
The number of examples used to compute the metrics.
method · iOS 16.0+precisionScore
TypeScriptprecisionScore(label: number): number
Swift declarationfunc precisionScore(label: Label) -> Double
Computes the precision score for a class label.
Precision score is computed as the ratio `tp / (tp + fp)` where `tp` is the number of true positives and `fp`
is the number of false positives.
- Parameter label: The label to use as true positive.
- Returns: The precision score for the given label.
method · iOS 17.0+trueNegativeCount
TypeScripttrueNegativeCount(label: number): number
Swift declarationfunc trueNegativeCount(of label: Label) -> Int
Returns the number of times a label was not in the predicted or ground truth collections.
- Parameter label: A label.
method · iOS 17.0+truePositiveCount
TypeScripttruePositiveCount(label: number): number
Swift declarationfunc truePositiveCount(of label: Label) -> Int
Returns the number of times the predicted label matched the true label.
- Parameter label: A label.
method · iOS 17.0+falseNegativeCount
TypeScriptfalseNegativeCount(label: number): number
Swift declarationfunc falseNegativeCount(of label: Label) -> Int
Returns the number of times a true label was not predicted.
- Parameter label: A label.
method · iOS 17.0+falsePositiveCount
TypeScriptfalsePositiveCount(label: number): number
Swift declarationfunc falsePositiveCount(of label: Label) -> Int
Returns the number of times the predicted label did not match the true label.
- Parameter label: A label.
get · iOS 17.0+restrictToKnownLabels
TypeScriptget restrictToKnownLabels(): boolean
Swift declarationvar restrictToKnownLabels: Bool
A Boolean value indicating whether to restrict metrics to labels in the labels set.
set · iOS 17.0+restrictToKnownLabels
TypeScriptset restrictToKnownLabels(value: boolean)
Swift declarationvar restrictToKnownLabels: Bool
A Boolean value indicating whether to restrict metrics to labels in the labels set.
method · iOS 17.0+count
TypeScriptcountLabel(label: number): number
Swift declarationfunc count(label: Label) -> Int
Returns the number of times a label appeared in the ground truth collection.
- Parameter label: The label.
method · iOS 17.0+count
TypeScriptcountPredictedLabel(predicted: number, label: number): number
Swift declarationfunc count(predicted: Label, label: Label) -> Int
Returns the number of times a predicted, true label pair appeared in the label collections.
- Parameters:
- predicted: The predicted label.
- label: The true label.
method · iOS 17.0+count
TypeScriptcountPredicted(predicted: number): number
Swift declarationfunc count(predicted: Label) -> Int
Returns the number of times a label appeared in the predicted collection.
- Parameter predicted: The label.
get · iOS 17.0+labels
TypeScriptget labels(): Array<number>
Swift declarationvar labels: Set<Label>
The set of labels.
set · iOS 17.0+labels
TypeScriptset labels(value: Array<number>)
Swift declarationvar labels: Set<Label>
The set of labels.
method · iOS 17.0+f1Score
TypeScriptf1Score(label: number): number
Swift declarationfunc f1Score(label: Label) -> Double
Computes the F1 score for a class label.
The balanced F-score, or F1 score, is computed as the harmonic mean of the precision and recall.
- Parameter label: The label to use as true positive.
- Returns: The F1 score for the given label.
get · iOS 16.0+accuracy
TypeScriptget accuracy(): number
Swift declarationvar accuracy: Double { get set }
The number of correctly classified examples out of the total number of examples.
set · iOS 16.0+accuracy
TypeScriptset accuracy(value: number)
Swift declarationvar accuracy: Double { get set }
The number of correctly classified examples out of the total number of examples.
method · iOS 17.0+mapLabels
TypeScriptmapLabels(transform: ((arg0: number) => number)): ClassificationMetrics<number>
Swift declarationfunc mapLabels<T>(_ transform: (Label) throws -> T) rethrows -> ClassificationMetrics<T> where T : Hashable
Returns new classification metrics where the labels are the result of applying a transformation.
The transformation can combine separate labels into one. The metrics will be adjusted accordingly by combining
counts from the original labels. An example of this is combining mixed cased labels into lowercase:
```swift
let metrics = ClassificationMetrics(predicted, groundTruth).map({ $0.lowercased() })
```
init · iOS 17.0+init
TypeScriptstatic initPredictedGroundTruthLabels(predicted: Array<number>, groundTruth: Array<number>, labels: Array<number>): ClassificationMetrics<number>
Swift declarationinit<Predicted, Correct>(predicted: Predicted, groundTruth: Correct, labels: Set<Label>) where Label == Predicted.Element, Predicted : Sequence, Correct : Sequence, Predicted.Element == Correct.Element
Creates classification metrics for predicted and ground truth labels.
The predicted and ground truth collections are matched element by element in the order they are provided. Both
collections must have the same number of elements. Labels not in the labels set are ignored.
- Parameters
- predicted: The predicted labels.
- groundTruth: The true labels.
- labels: The set of labels to consider.
init · iOS 17.0+init
TypeScriptstatic init(): ClassificationMetrics<number>
Swift declarationinit()
Creates empty classification metrics.
init · iOS 16.0+init
TypeScriptstatic init94512(predicted: Array<number>, groundTruth: Array<number>): ClassificationMetrics<number>
Swift declarationinit<Predicted, Correct>(_ predicted: Predicted, _ groundTruth: Correct) where Label == Predicted.Element, Predicted : Collection, Correct : Collection, Predicted.Element == Correct.Element
Creates classification metrics for predicted and ground truth labels.
The predicted and ground truth collections are matched element by element in the order they are provided. Both
collections must have the same number of elements.
- Parameters
- predicted: The predicted labels.
- groundTruth: The true labels.
get · iOS 17.0+defaultConfidenceThreshold
TypeScriptget defaultConfidenceThreshold(): number
Swift declarationvar defaultConfidenceThreshold: Float
The default confidence threshold. It is used as the confidence threshold for any label which does not have an explicit confidence threshold, while calculating
averagePrecision and meanAveragePrecision.
set · iOS 17.0+defaultConfidenceThreshold
TypeScriptset defaultConfidenceThreshold(value: number)
Swift declarationvar defaultConfidenceThreshold: Float
The default confidence threshold. It is used as the confidence threshold for any label which does not have an explicit confidence threshold, while calculating
averagePrecision and meanAveragePrecision.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: ComposedTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
init · iOS 16.0+init
TypeScriptstatic initContentsOfConfiguration(url: string, configuration: _CoreML_MLModelConfiguration): MLModelRegressorAdaptor<number>
Swift declarationinit(contentsOf url: URL, configuration: MLModelConfiguration) throws
Creates a model adaptor from a CoreML model URL.
init · iOS 16.0+init
TypeScriptstatic initModel(model: _CoreML_MLModel): MLModelRegressorAdaptor<number>
Swift declarationinit(model: MLModel) throws
Creates a MLModel regressor adaptor from a model.
- Parameters:
- model: An MLModel.
get · iOS 16.0+model
TypeScriptget model(): _CoreML_MLModel
Swift declarationlet model: MLModel
The CoreML model.
method · iOS 16.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<number>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> Double
Performs a prediction from a single input.
- Parameters:
- input: The input feature.
- eventHandler: An event handler.
- Returns: A regression result.
get · iOS 16.0+resultsColumnName
TypeScriptget resultsColumnName(): string
Swift declarationvar resultsColumnName: String
The results column name.
set · iOS 16.0+resultsColumnName
TypeScriptset resultsColumnName(value: string)
Swift declarationvar resultsColumnName: String
The results column name.
get · iOS 16.0+annotationColumnID
TypeScriptget annotationColumnID(): _TabularData_ColumnID<SDKHandle>
Swift declarationvar annotationColumnID: ColumnID<AnnotatedFeatureProvider<Base, UnwrappedInput>.Annotation>
The annotation column identifier.
set · iOS 16.0+annotationColumnID
TypeScriptset annotationColumnID(value: _TabularData_ColumnID<SDKHandle>)
Swift declarationvar annotationColumnID: ColumnID<AnnotatedFeatureProvider<Base, UnwrappedInput>.Annotation>
The annotation column identifier.
get · iOS 16.0+featuresColumnName
TypeScriptget featuresColumnName(): string
Swift declarationvar featuresColumnName: String
The features column name.
set · iOS 16.0+featuresColumnName
TypeScriptset featuresColumnName(value: string)
Swift declarationvar featuresColumnName: String
The features column name.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ColumnSelectorTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> AnnotatedFeatureProvider<Base, UnwrappedInput>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: ColumnSelectorTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: AnnotatedFeatureProvider<Base, UnwrappedInput>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
init · iOS 16.0+init
TypeScriptstatic initContentsOfConfiguration(url: string, configuration: _CoreML_MLModelConfiguration): MLModelClassifierAdaptor<number>
Swift declarationinit(contentsOf url: URL, configuration: MLModelConfiguration) throws
Creates a model adaptor from a CoreML model URL.
init · iOS 16.0+init
TypeScriptstatic initStringLiteral(value: string): MLModelClassifierAdaptor_Label<number>
Swift declarationinit(stringLiteral value: String)
Creates a Label with a string literal.
init · iOS 16.0+init
TypeScriptstatic initIntegerLiteral(value: number): MLModelClassifierAdaptor_Label<number>
Swift declarationinit(integerLiteral value: Int)
Creates a Label with an integer literal.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A text representation of the label.
init · iOS 16.0+init
TypeScriptstatic initModel(model: _CoreML_MLModel): MLModelClassifierAdaptor<number>
Swift declarationinit(model: MLModel) throws
Creates a MLModel classifier adaptor from a model.
- Parameters:
- model: An MLModel.
get · iOS 16.0+model
TypeScriptget model(): _CoreML_MLModel
Swift declarationlet model: MLModel
The CoreML model.
method · iOS 16.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<ClassificationDistribution<MLModelClassifierAdaptor_Label<number>>>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> ClassificationDistribution<MLModelClassifierAdaptor<Scalar>.Label>
Performs a prediction from a single input.
- Parameters:
- input: The input feature.
- eventHandler: An event handler.
- Returns: A classification distribution.
method · iOS 16.0+makeAsyncIterator
TypeScriptmakeAsyncIterator(): SlidingWindowTransformer_WindowSequence_Iterator<number>
Swift declarationfunc makeAsyncIterator() -> SlidingWindowTransformer<Input>.WindowSequence.Iterator
Creates the asynchronous iterator that produces elements of this
asynchronous sequence.
- Returns: An instance of the `AsyncIterator` type used to produce
elements of the asynchronous sequence.
get · iOS 16.0+count
TypeScriptget count(): (number) | null
Swift declarationvar count: Int? { get }
The number of elements in the sequence.
method · iOS 16.0+next
TypeScriptnext(): Promise<(TemporalFeature<Array<number>>) | null>
Swift declarationmutating func next() async throws -> TemporalFeature<SlidingWindowTransformer<Input>.Output>?
Asynchronously advances to the next element and returns it, or ends the
sequence if there is no next element.
- Returns: The next element, if it exists, or `nil` to signal the end of
the sequence.
get · iOS 16.0+length
TypeScriptget length(): number
Swift declarationlet length: Int
The length of a window.
init · iOS 16.0+init
TypeScriptstatic init(stride: number, length: number): SlidingWindowTransformer<number>
Swift declarationinit(stride: Int, length: Int)
Creates a window temporal transformer.
- Parameters:
- stride: The number of frames between the start of two consecutive windows. Must be greater than 0.
- length: The length of a window in number of frames. Must be greater than 0.
get · iOS 16.0+stride
TypeScriptget stride(): number
Swift declarationlet stride: Int
The number of elements between the start of two consecutive windows.
get · iOS 16.0+columnMapping
TypeScriptget columnMapping(): Record<string, string>
Swift declarationvar columnMapping: [String : String]
A mapping of input column names to output column names.
set · iOS 16.0+columnMapping
TypeScriptset columnMapping(value: Record<string, string>)
Swift declarationvar columnMapping: [String : String]
A mapping of input column names to output column names.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 16.0+applied
TypeScriptapplied(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<_TabularData_DataFrame>
Swift declarationfunc applied(to input: DataFrame, eventHandler: EventHandler? = nil) async throws -> DataFrame
Performs the transformation on selected columns of the data frame.
- Parameters:
- input: A data frame.
- eventHandler: An event handler.
- Returns: A data frame produced by applying the transformer to selected columns.
init · iOS 16.0+init
TypeScriptstatic initContentsOfConfiguration(url: string, configuration: _CoreML_MLModelConfiguration): MLModelTransformerAdaptor<number>
Swift declarationinit(contentsOf url: URL, configuration: MLModelConfiguration) throws
Creates a model adaptor from a CoreML model URL.
init · iOS 16.0+init
TypeScriptstatic initModel(model: _CoreML_MLModel): MLModelTransformerAdaptor<number>
Swift declarationinit(model: MLModel) throws
Creates a model adaptor from an MLModel.
- Parameters:
- model: An MLModel.
get · iOS 16.0+model
TypeScriptget model(): _CoreML_MLModel
Swift declarationlet model: MLModel
The CoreML model.
method · iOS 16.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<_CoreML_MLShapedArray<number>>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> MLShapedArray<Scalar>
Performs a transformation on a single input.
- Parameters:
- input: The input.
- eventHandler: An event handler.
- Returns: The transformed input.
get · iOS 17.0+stringValue
TypeScriptgetStringValue($self: ObjectDetectionAnnotation_Annotation_CodingKeys): string
Swift declarationvar stringValue: String { get }
The string to use in a named collection (e.g. a string-keyed dictionary).
get · iOS 17.0+intValue
TypeScriptgetIntValue($self: ObjectDetectionAnnotation_Annotation_CodingKeys): (number) | null
Swift declarationvar intValue: Int? { get }
The value to use in an integer-indexed collection (e.g. an int-keyed
dictionary).
get · iOS 17.0+rawValue
TypeScriptgetRawValue($self: ObjectDetectionAnnotation_Annotation_CodingKeys): string
Swift declarationvar rawValue: String { get }
The corresponding value of the raw type.
A new instance initialized with `rawValue` will be equivalent to this
instance. For example:
enum PaperSize: String {
case A4, A5, Letter, Legal
}
let selectedSize = PaperSize.Letter
print(selectedSize.rawValue)
// Prints "Letter"
print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
// Prints "true"
get · iOS 17.0+boundingBox
TypeScriptget boundingBox(): { x: number; y: number; width: number; height: number }
Swift declarationlet boundingBox: CGRect
The bounding box that describes the spatial location of the object.
get · iOS 17.0+stringValue
TypeScriptgetStringValue($self: ObjectDetectionAnnotation_CodingKeys): string
Swift declarationvar stringValue: String { get }
The string to use in a named collection (e.g. a string-keyed dictionary).
get · iOS 17.0+intValue
TypeScriptgetIntValue($self: ObjectDetectionAnnotation_CodingKeys): (number) | null
Swift declarationvar intValue: Int? { get }
The value to use in an integer-indexed collection (e.g. an int-keyed
dictionary).
get · iOS 17.0+rawValue
TypeScriptgetRawValue($self: ObjectDetectionAnnotation_CodingKeys): string
Swift declarationvar rawValue: String { get }
The corresponding value of the raw type.
A new instance initialized with `rawValue` will be equivalent to this
instance. For example:
enum PaperSize: String {
case A4, A5, Letter, Legal
}
let selectedSize = PaperSize.Letter
print(selectedSize.rawValue)
// Prints "Letter"
print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
// Prints "true"
get · iOS 17.0+imageFileName
TypeScriptget imageFileName(): string
Swift declarationlet imageFileName: String
The name of the image file.
get · iOS 17.0+id
TypeScriptget id(): string
Swift declarationvar id: String { get }
The identifier of the object detection annotation
get · iOS 17.0+objects
TypeScriptget objects(): Array<ObjectDetectionAnnotation_Annotation<SDKHandle>>
Swift declarationlet objects: [ObjectDetectionAnnotation<Label>.Annotation]
The list of object annotations in the image.
get · iOS 16.0+startIndex
TypeScriptget startIndex(): number
Swift declarationvar startIndex: Int { get }
The index of the initial element in the classification distribution.
get · iOS 16.0+mostLikelyLabel
TypeScriptget mostLikelyLabel(): (number) | null
Swift declarationvar mostLikelyLabel: Label? { get }
The label with the highest probability.
get · iOS 16.0+labelsSortedByProbability
TypeScriptget labelsSortedByProbability(): Array<number>
Swift declarationvar labelsSortedByProbability: [Label] { get }
The labels sorted by decreasing probability.
method · iOS 16.0+map
TypeScriptmap(transform: ((arg0: Classification<number>) => Classification<number>)): ClassificationDistribution<number>
Swift declarationfunc map<T>(_ transform: (Classification<Label>) throws -> Classification<T>) rethrows -> ClassificationDistribution<T> where T : Hashable
Creates a new classification distribution by applying a transformation to every element.
- Parameter transform: A transformation closure.
method · iOS 16.0+index
TypeScriptindexAfter(i: number): number
Swift declarationfunc index(after i: Int) -> Int
Returns the index immediately after an element index.
- Parameter i: A valid index to an element in the classification distribution.
method · iOS 16.0+index
TypeScriptindexBefore(i: number): number
Swift declarationfunc index(before i: Int) -> Int
Returns the index immediately before an element index.
- Parameter i: A valid index to an element in the classification distribution.
get · iOS 16.0+endIndex
TypeScriptget endIndex(): number
Swift declarationvar endIndex: Int { get }
The index of the final element in the classification distribution.
method · iOS 16.0+topLabels
TypeScripttopLabels(amount: number): Array<number>
Swift declarationfunc topLabels(_ amount: Int) -> [Label]
Computes the most likely labels in the classification set.
- Parameter amount: The number of top labels.
- Returns: The labels with the highest probabilities.
subscript · iOS 16.0+subscript
TypeScriptsubscript(index: number): Classification<number>
Swift declarationsubscript(index: Int) -> Classification<Label> { get }
Accesses a classification at an index.
- Parameter index: A valid index to a classification in the classification distribution.
init · iOS 16.0+init
TypeScriptstatic init(classifications: Array<Classification<number>>): ClassificationDistribution<number>
Swift declarationinit<C>(_ classifications: C) where C : Collection, C.Element == Classification<Label>
Creates a classification distribution.
- Parameter classifications: A collection of classifications.
- Precondition: The classifications must contain unique labels.
subscript · iOS 16.0+subscript
TypeScriptsubscript33028(label: number): (number) | null
Swift declarationsubscript(label: Label) -> Float? { get }
Accesses a probability with label.
- Parameter label: A label in the classification set.
subscript · iOS 16.0+subscript
TypeScriptsubscript19732(bounds: SDKHandle): SDKHandle
Swift declarationsubscript(bounds: Range<Int>) -> Slice<ClassificationDistribution<Label>> { get }
Accesses a contiguous range of elements.
- Parameter bounds: A range of valid indices in the classification distribution.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+inner
TypeScriptget inner(): TreeRegressorModel
Swift declarationvar inner: Inner
The inner transformer.
set · iOS 16.0+inner
TypeScriptset inner(value: TreeRegressorModel)
Swift declarationvar inner: Inner
The inner transformer.
get · iOS 16.0+outer
TypeScriptget outer(): TreeRegressorModel
Swift declarationvar outer: Outer
The outer transformer.
set · iOS 16.0+outer
TypeScriptset outer(value: TreeRegressorModel)
Swift declarationvar outer: Outer
The outer transformer.
method · iOS 16.0+applied
TypeScriptapplied(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<_TabularData_DataFrame>
Swift declarationfunc applied(to input: DataFrame, eventHandler: EventHandler? = nil) async throws -> DataFrame
Performs the composed transformation on a single input.
- Parameters:
- input: The transformer input.
- eventHandler: An event handler.
- Returns: An output produced by applying the transformer to the input.
init · iOS 16.0+init
TypeScriptstatic init(inner: TreeRegressorModel, outer: TreeRegressorModel): ComposedTabularTransformer<TreeRegressorModel, TreeRegressorModel>
Swift declarationinit(_ inner: Inner, _ outer: Outer)
Creates a composed tabular transformer from two tabular transformers.
- Parameters:
- inner: The inner transformer.
- outer: The outer transformer.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: TransformerToTemporalAdaptor<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> EstimatorToTemporalAdaptor<Base>.Transformer
Decodes the transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: TransformerToTemporalAdaptor<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: EstimatorToTemporalAdaptor<Base>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 18.0+configuration
TypeScriptget configuration(): LinearTimeSeriesForecasterConfiguration
Swift declarationlet configuration: LinearTimeSeriesForecaster<Scalar>.Configuration
The configuration.
init · iOS 18.0+init
TypeScriptstatic init(configuration: LinearTimeSeriesForecasterConfiguration): LinearTimeSeriesForecaster<number>
Swift declarationinit(configuration: LinearTimeSeriesForecaster<Scalar>.Configuration)
Creates a linear time-series forecaster.
- Parameter configuration: The configuration parameters.
get · iOS 18.0+inputWindowSize
TypeScriptget inputWindowSize(): number
Swift declarationvar inputWindowSize: Int { get }
The number of input samples.
method · iOS 18.0+makeTransformer
TypeScriptmakeTransformer(): LinearTimeSeriesForecaster_Model<number>
Swift declarationfunc makeTransformer() -> LinearTimeSeriesForecaster<Scalar>.Model
Creates a default-initialized model suitable for incremental fitting.
get · iOS 18.0+forecastWindowSize
TypeScriptget forecastWindowSize(): number
Swift declarationvar forecastWindowSize: Int { get }
The number of predicted samples.
method · iOS 18.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: LinearTimeSeriesForecaster_Model<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> LinearTimeSeriesForecaster<Scalar>.Transformer
Reads the encoded model and optimizer with a decoder.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 18.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(model: LinearTimeSeriesForecaster_Model<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ model: LinearTimeSeriesForecaster<Scalar>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the model and optimizer to an encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 18.0+featureSize
TypeScriptget featureSize(): number
Swift declarationvar featureSize: Int { get }
The number of features per sample.
get · iOS 18.0+annotationSize
TypeScriptget annotationSize(): number
Swift declarationvar annotationSize: Int { get }
The number of annotations per sample.
get · iOS 18.0+inputWindowSize
TypeScriptget inputWindowSize(): number
Swift declarationvar inputWindowSize: Int { get }
The number of input samples.
get · iOS 18.0+forecastWindowSize
TypeScriptget forecastWindowSize(): number
Swift declarationvar forecastWindowSize: Int { get }
The number of prediction samples.
get · iOS 18.0+bias
TypeScriptget bias(): (_CoreML_MLShapedArray<number>) | null
Swift declarationvar bias: MLShapedArray<Scalar>? { get }
The bias coefficients.
method · iOS 18.0+export
TypeScriptexportToMetadata(url: string, metadata: ModelMetadata): void
Swift declarationfunc export(to url: URL, metadata: ModelMetadata) throws
Exports this transformer as a CoreML model package with user-supplied metadata.
- Parameters:
- url: The location to write the model into.
- metadata: Contextual user-provided information.
method · iOS 18.0+export
TypeScriptexportTo(url: string): void
Swift declarationfunc export(to url: URL) throws
Exports this transformer as a CoreML model package.
- Parameter url: The location to write the model into.
get · iOS 18.0+stride
TypeScriptget stride(): number
Swift declarationvar stride: Int
The number of samples between windows.
set · iOS 18.0+stride
TypeScriptset stride(value: number)
Swift declarationvar stride: Int
The number of samples between windows.
get · iOS 18.0+weight
TypeScriptget weight(): _CoreML_MLShapedArray<number>
Swift declarationvar weight: MLShapedArray<Scalar> { get }
The linear coefficients.
method · iOS 18.0+applied
TypeScriptappliedToEventHandler(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<_CoreML_MLShapedArray<number>>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> MLShapedArray<Scalar>
Performs a prediction on a shaped array of features.
This method uses a sliding window to chunk the input features into ``inputWindowSize`` elements every
``stride`` elements. If you want to use a different windowing strategy, use
``applied(toWindow:eventHandler:)``.
- Parameters:
- input: An shaped array of features. The shape must be `[N, featureSize]` where `N` is the length of the
sequence, which must be at least `inputWindowSize`.
- eventHandler: An event handler.
- Returns: A shaped array of predictions with shape `[M, forecastWindowSize, annotationSize]` where `M`
is the number of predictions based on the input sequence length and the ``stride`` property.
method · iOS 18.0+applied
TypeScriptappliedToWindowEventHandler(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<_CoreML_MLShapedArray<number>>
Swift declarationfunc applied(toWindow input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> MLShapedArray<Scalar>
Performs a prediction on a window of input features.
- Parameters:
- input: An window of input features with shape `[inputWindowSize, featureSize]`.
- eventHandler: An event handler.
- Returns: A shaped array of predictions with shape `[forecastWindowSize, annotationSize]`.
method · iOS 18.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: LinearTimeSeriesForecaster_Model<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> LinearTimeSeriesForecaster<Scalar>.Transformer
Decodes a previously fitted model.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 18.0+encode
TypeScriptencode(model: LinearTimeSeriesForecaster_Model<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ model: LinearTimeSeriesForecaster<Scalar>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted model.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 18.0+update
TypeScriptupdate(model: LinearTimeSeriesForecaster_Model<number>, input: AnnotatedBatch<number>): Promise<{ $ret: number; $out: { "model": LinearTimeSeriesForecaster_Model<number> } }>
Swift declarationfunc update(_ model: inout LinearTimeSeriesForecaster<Scalar>.Transformer, with input: AnnotatedBatch<Scalar>) async throws -> Scalar
Updates a model with a new batch of examples.
Use ``TimeSeriesForecasterBatches`` to convert a shaped array of features into batches of windowed
features and annotations. Here is an example of training a forecaster:
```
let estimator = LinearTimeSeriesForecaster<Float>(configuration: configuration)
var model = estimator.makeTransformer()
let batches = try TimeSeriesForecasterBatches(
features: features, // shape [N, featureSize]
annotations: annotations, // shape [N, annotationSize]
batchSize: 32,
inputWindowSize: configuration.inputWindowSize,
forecastWindowSize: configuration.forecastWindowSize,
shufflesBatches: true
)
for iteration in 0 ..< configuration.maximumIterationCount {
for batch in batches {
let loss = try await estimator.update(&model, with: batch)
print("Loss: \(loss)")
}
}
```
- Parameters:
- model: The model to update.
- input: A shaped array of windowed features. The shape should be
`[batchSize, inputWindowSize, featureSize]`.
Omit the output parameters from the call. The result contains $ret and $out, with model inside $out.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 18.0+configuration
TypeScriptget configuration(): MultivariateLinearRegressorConfiguration
Swift declarationvar configuration: MultivariateLinearRegressor<Scalar>.Configuration
The linear regressor configuration.
set · iOS 18.0+configuration
TypeScriptset configuration(value: MultivariateLinearRegressorConfiguration)
Swift declarationvar configuration: MultivariateLinearRegressor<Scalar>.Configuration
The linear regressor configuration.
method · iOS 18.0+makeTransformer
TypeScriptmakeTransformer(): MultivariateLinearRegressor_Model<number>
Swift declarationfunc makeTransformer() -> MultivariateLinearRegressor<Scalar>.Model
Creates a default-initialized model suitable for incremental fitting.
method · iOS 18.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: MultivariateLinearRegressor_Model<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> MultivariateLinearRegressor<Scalar>.Model
Reads the encoded model and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded model.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 18.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(model: MultivariateLinearRegressor_Model<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ model: MultivariateLinearRegressor<Scalar>.Model, to encoder: inout any EstimatorEncoder) throws
Encodes the model and optimizer to an encoder.
- Parameters:
- model: A model this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 18.0+outputSize
TypeScriptget outputSize(): number
Swift declarationvar outputSize: Int { get }
The output size.
get · iOS 18.0+bias
TypeScriptget bias(): (_CoreML_MLShapedArray<number>) | null
Swift declarationvar bias: MLShapedArray<Scalar>? { get }
The bias coefficients.
init · iOS 18.0+init
TypeScriptstatic init(weight: _CoreML_MLShapedArray<number>, bias?: (_CoreML_MLShapedArray<number>) | null): MultivariateLinearRegressor_Model<number>
Swift declarationinit(weight: MLShapedArray<Scalar>, bias: MLShapedArray<Scalar>?)
Creates a multivariate linear regressor.
- Parameters:
- weight: A shaped array of linear weights.
- bias: A one-dimensional shaped array of biases.
get · iOS 18.0+weight
TypeScriptget weight(): _CoreML_MLShapedArray<number>
Swift declarationvar weight: MLShapedArray<Scalar> { get }
The linear coefficients.
method · iOS 18.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<_CoreML_MLShapedArray<number>>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> MLShapedArray<Scalar>
Performs a prediction on a shaped array.
- Parameters:
- input: A shaped array of features. The last dimension must be `inputSize`.
- eventHandler: An event handler.
- Returns: A shaped array of predictions. The shape of the predictions matches the shape of the input
except for the last dimension, which is `outputSize`.
get · iOS 18.0+inputSize
TypeScriptget inputSize(): number
Swift declarationvar inputSize: Int { get }
The input size.
method · iOS 18.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: MultivariateLinearRegressor_Model<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> MultivariateLinearRegressor<Scalar>.Model
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 18.0+encode
TypeScriptencode(model: MultivariateLinearRegressor_Model<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ model: MultivariateLinearRegressor<Scalar>.Model, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 18.0+fitted
TypeScriptfitted(input: AnnotatedBatch<number>, validation?: (AnnotatedBatch<number>) | null, eventHandler?: (((arg0: Event) => void)) | null): Promise<MultivariateLinearRegressor_Model<number>>
Swift declarationfunc fitted(to input: AnnotatedBatch<Scalar>, validateOn validation: AnnotatedBatch<Scalar>?, eventHandler: EventHandler? = nil) async throws -> MultivariateLinearRegressor<Scalar>.Model
Fits a linear regressor model to shaped arrays of features and annotations.
- Parameters:
- input: An annotated batch containing the features and annotations. The last dimension of the features is
the model's input size and the last dimension of the annotations is the model's output size. All the
leading dimensions of the features must match all leading dimensions of the annotations. For example, the
feature shape can be `[N, X]` and the annotation shape can be `[N, Y]` for `N` examples where `X` is the
input size and `Y` is the output size.
- validation: An annotated batch containing the validation features and annotations. The last dimension of
the features must be `inputSize` and the last dimension of the annotations must be `outputSize`. All the
leading dimensions of the features must match all leading dimensions of the annotations.
- eventHandler: An event handler. This method reports the mean squared errors.
- Returns: The fitted model.
method · iOS 18.0+update
TypeScriptupdate(model: MultivariateLinearRegressor_Model<number>, input: AnnotatedBatch<number>): Promise<{ $ret: number; $out: { "model": MultivariateLinearRegressor_Model<number> } }>
Swift declarationfunc update(_ model: inout MultivariateLinearRegressor<Scalar>.Model, with input: AnnotatedBatch<Scalar>) async throws -> Scalar
Updates a model with a new shaped array of examples.
- Parameters:
- model: A model to update.
- input: An annotated batch containing the features and annotations. The last dimension of the features is
the model's input size and the last dimension of the annotations is the model's output size. All the
leading dimensions of the features must match all leading dimensions of the annotations. For example, the
feature shape can be `[N, X]` and the annotation shape can be `[N, Y]` for `N` examples where `X` is the
input size and `Y` is the output size.
- Returns: The mean squared error for the batch, also known as the batch loss.
Omit the output parameters from the call. The result contains $ret and $out, with model inside $out.
method · iOS 16.0+next
TypeScriptnext(): (TemporalFeature<unknown>) | null
Swift declarationmutating func next() -> TemporalFeature<Feature>?
Asynchronously advances to the next element and returns it, or ends the
sequence if there is no next element.
- Returns: The next element, if it exists, or `nil` to signal the end of
the sequence.
method · iOS 16.0+makeAsyncIterator
TypeScriptmakeAsyncIterator(): PreprocessedFeatureSequence_AsyncIterator<unknown>
Swift declarationfunc makeAsyncIterator() -> PreprocessedFeatureSequence<Feature>.AsyncIterator
Creates the asynchronous iterator that produces elements of this
asynchronous sequence.
- Returns: An instance of the `AsyncIterator` type used to produce
elements of the asynchronous sequence.
get · iOS 16.0+count
TypeScriptget count(): (number) | null
Swift declarationvar count: Int? { get }
The stored temporal feature count.
get · iOS 16.0+features
TypeScriptget features(): Array<TemporalFeature<unknown>>
Swift declarationvar features: [TemporalFeature<Feature>]
The stored temporal features.
set · iOS 16.0+features
TypeScriptset features(value: Array<TemporalFeature<unknown>>)
Swift declarationvar features: [TemporalFeature<Feature>]
The stored temporal features.
get · iOS 18.0+shufflesBatches
TypeScriptget shufflesBatches(): boolean
Swift declarationvar shufflesBatches: Bool
A Boolean value indicating whether to shuffle the batches.
set · iOS 18.0+shufflesBatches
TypeScriptset shufflesBatches(value: boolean)
Swift declarationvar shufflesBatches: Bool
A Boolean value indicating whether to shuffle the batches.
get · iOS 18.0+annotations
TypeScriptget annotations(): _CoreML_MLShapedArray<number>
Swift declarationlet annotations: MLShapedArray<Scalar>
The original annotations.
method · iOS 18.0+makeIterator
TypeScriptmakeIterator(): TimeSeriesForecasterBatches_Iterator<number>
Swift declarationfunc makeIterator() -> TimeSeriesForecasterBatches<Scalar>.Iterator
Returns an iterator over the elements of this sequence.
get · iOS 18.0+inputWindowSize
TypeScriptget inputWindowSize(): number
Swift declarationlet inputWindowSize: Int
The input sample count.
get · iOS 18.0+forecastWindowSize
TypeScriptget forecastWindowSize(): number
Swift declarationlet forecastWindowSize: Int
The prediction sample count.
get · iOS 18.0+underestimatedCount
TypeScriptget underestimatedCount(): number
Swift declarationvar underestimatedCount: Int { get }
A value less than or equal to the number of elements in the sequence,
calculated nondestructively.
The default implementation returns 0. If you provide your own
implementation, make sure to compute the value nondestructively.
- Complexity: O(1), except if the sequence also conforms to `Collection`.
In this case, see the documentation of `Collection.underestimatedCount`.
method · iOS 18.0+next
TypeScriptnext(): (AnnotatedBatch<number>) | null
Swift declarationmutating func next() -> AnnotatedBatch<Scalar>?
Advances to the next element and returns it, or `nil` if no next element
exists.
Repeatedly calling this method returns, in order, all the elements of the
underlying sequence. As soon as the sequence has run out of elements, all
subsequent calls return `nil`.
You must not call this method if any other copy of this iterator has been
advanced with a call to its `next()` method.
The following example shows how an iterator can be used explicitly to
emulate a `for`-`in` loop. First, retrieve a sequence's iterator, and
then call the iterator's `next()` method until it returns `nil`.
let numbers = [2, 3, 5, 7]
var numbersIterator = numbers.makeIterator()
while let num = numbersIterator.next() {
print(num)
}
// Prints "2"
// Prints "3"
// Prints "5"
// Prints "7"
- Returns: The next element in the underlying sequence, if a next element
exists; otherwise, `nil`.
init · iOS 18.0+init
TypeScriptstatic init(features: _CoreML_MLShapedArray<number>, annotations: _CoreML_MLShapedArray<number>, batchSize: number, inputWindowSize: number, forecastWindowSize: number, shufflesBatches?: boolean): TimeSeriesForecasterBatches<number>
Swift declarationinit(features: MLShapedArray<Scalar>, annotations: MLShapedArray<Scalar>, batchSize: Int, inputWindowSize: Int, forecastWindowSize: Int, shufflesBatches: Bool = true) throws
Creates a batch sequence.
- Parameters:
- features: A shaped array of features, it must have two dimensions.
- annotations: A shaped array of annotations, it must have two dimensions.
- batchSize: The batch size. Must be positive.
- inputWindowSize: The number of input samples. Must be positive.
- forecastWindowSize: The number of prediction samples. Must be positive.
- shufflesBatches: A Boolean value indicating whether to shuffle the batches.
get · iOS 18.0+features
TypeScriptget features(): _CoreML_MLShapedArray<number>
Swift declarationlet features: MLShapedArray<Scalar>
The original features.
get · iOS 18.0+batchSize
TypeScriptget batchSize(): number
Swift declarationlet batchSize: Int
The batch size.
function · iOS 17.0+meanAbsolutePercentageError
TypeScriptmeanAbsolutePercentageError(annotatedPredictions: Array<AnnotatedPrediction<number, number>>): number
Swift declarationfunc meanAbsolutePercentageError<T>(_ annotatedPredictions: [AnnotatedPrediction<T, T>]) -> T where T : FloatingPoint
Computes the mean absolute percentage error between predicted and ground truth values.
If an empty `AnnotatedPrediction` is supplied, the result will be NaN.
- Parameters:
- annotatedPredictions: An `AnnotatedPrediction` object.
- Returns: The mean absolute percentage error as a decimal value.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: unknown; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> EstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Returns the pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: unknown, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: EstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to encoder: inout any EstimatorEncoder) throws
Does nothing since this estimator uses a pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 17.0+scaleFeatures
TypeScriptget scaleFeatures(): boolean
Swift declarationvar scaleFeatures: Bool
A Boolean value indicating whether to scale the input features.
Scaling the features reduces numerical errors.
set · iOS 17.0+scaleFeatures
TypeScriptset scaleFeatures(value: boolean)
Swift declarationvar scaleFeatures: Bool
A Boolean value indicating whether to scale the input features.
Scaling the features reduces numerical errors.
get · iOS 16.0+maximumIterations
TypeScriptget maximumIterations(): number
Swift declarationvar maximumIterations: Int
The maximum number of allowed passes through the data.
More passes over the data can result in a more accurately trained model. Consider increasing this if the
training accuracy is low. Defaults to 25.
- Note: This parameter is only used by the `fitted` method. When using the `update` method it's up to you
to decide when to stop.
set · iOS 16.0+maximumIterations
TypeScriptset maximumIterations(value: number)
Swift declarationvar maximumIterations: Int
The maximum number of allowed passes through the data.
More passes over the data can result in a more accurately trained model. Consider increasing this if the
training accuracy is low. Defaults to 25.
- Note: This parameter is only used by the `fitted` method. When using the `update` method it's up to you
to decide when to stop.
get · iOS 16.0+convergenceThreshold
TypeScriptget convergenceThreshold(): number
Swift declarationvar convergenceThreshold: Double
The convergence threshold.
When the residual is within the convergence threshold of the objective, training stops. The threshold is
also used by the `fitted` method to decide when progress is no longer being made, in which case the
training process will stop before convergence and before the specified maximum number of iterations (known
as early stopping).
Consider reducing this value for a more accurately trained model. But beware of overfitting if the it is
set to a very low value. Defaults to 0.01.
set · iOS 16.0+convergenceThreshold
TypeScriptset convergenceThreshold(value: number)
Swift declarationvar convergenceThreshold: Double
The convergence threshold.
When the residual is within the convergence threshold of the objective, training stops. The threshold is
also used by the `fitted` method to decide when progress is no longer being made, in which case the
training process will stop before convergence and before the specified maximum number of iterations (known
as early stopping).
Consider reducing this value for a more accurately trained model. But beware of overfitting if the it is
set to a very low value. Defaults to 0.01.
get · iOS 17.0+optimizationStrategy
TypeScriptget optimizationStrategy(): OptimizationStrategy
Swift declarationvar optimizationStrategy: OptimizationStrategy { get set }
The optimization strategy.
set · iOS 17.0+optimizationStrategy
TypeScriptset optimizationStrategy(value: OptimizationStrategy)
Swift declarationvar optimizationStrategy: OptimizationStrategy { get set }
The optimization strategy.
get · iOS 17.0+earlyStopIterationCount
TypeScriptget earlyStopIterationCount(): number
Swift declarationvar earlyStopIterationCount: Int
The number of iterations to use when evaluating whether to stop early.
The `fitted` method will stop if no significant progress is made for this many iterations. Significant
progress happens when the validation accuracy increases by at least `convergenceThreshold`.
- Note: Early stopping only happens when using the `fitted` method with validation data.
set · iOS 17.0+earlyStopIterationCount
TypeScriptset earlyStopIterationCount(value: number)
Swift declarationvar earlyStopIterationCount: Int
The number of iterations to use when evaluating whether to stop early.
The `fitted` method will stop if no significant progress is made for this many iterations. Significant
progress happens when the validation accuracy increases by at least `convergenceThreshold`.
- Note: Early stopping only happens when using the `fitted` method with validation data.
get · iOS 16.0+stepSize
TypeScriptget stepSize(): number
Swift declarationvar stepSize: Double
The starting step size to use for the solver.
Defaults to 1.0. If the first iteration takes a considerable amount of time, reducing this parameter may speed
up model training.
set · iOS 16.0+stepSize
TypeScriptset stepSize(value: number)
Swift declarationvar stepSize: Double
The starting step size to use for the solver.
Defaults to 1.0. If the first iteration takes a considerable amount of time, reducing this parameter may speed
up model training.
get · iOS 16.0+l1Penalty
TypeScriptget l1Penalty(): number
Swift declarationvar l1Penalty: Double
Weight of the L1 regularization term.
Like the l2 penalty, the higher the l1 penalty, the more the estimated coefficients shrink toward 0. The l1
penalty, however, completely zeros out sufficiently small coefficients, automatically indicating features that
are not useful for the model. The default weight of 0 prevents any features from being discarded.
set · iOS 16.0+l1Penalty
TypeScriptset l1Penalty(value: number)
Swift declarationvar l1Penalty: Double
Weight of the L1 regularization term.
Like the l2 penalty, the higher the l1 penalty, the more the estimated coefficients shrink toward 0. The l1
penalty, however, completely zeros out sufficiently small coefficients, automatically indicating features that
are not useful for the model. The default weight of 0 prevents any features from being discarded.
get · iOS 16.0+l2Penalty
TypeScriptget l2Penalty(): number
Swift declarationvar l2Penalty: Double
Weight of the L2 regularization term.
The larger this weight, the more the model coefficients shrink toward 0. This introduces bias into the model
but decreases variance, potentially leading to better predictions. The default is 0.01.
set · iOS 16.0+l2Penalty
TypeScriptset l2Penalty(value: number)
Swift declarationvar l2Penalty: Double
Weight of the L2 regularization term.
The larger this weight, the more the model coefficients shrink toward 0. This introduces bias into the model
but decreases variance, potentially leading to better predictions. The default is 0.01.
get · iOS 16.0+configuration
TypeScriptget configuration(): LogisticRegressionClassifier_Configuration<number, SDKHandle>
Swift declarationvar configuration: LogisticRegressionClassifier<Scalar, Label>.Configuration { get set }
The logistic regression classifier configuration.
set · iOS 16.0+configuration
TypeScriptset configuration(value: LogisticRegressionClassifier_Configuration<number, SDKHandle>)
Swift declarationvar configuration: LogisticRegressionClassifier<Scalar, Label>.Configuration { get set }
The logistic regression classifier configuration.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): LogisticRegressionClassifierModel<number, SDKHandle>
Swift declarationfunc makeTransformer() -> LogisticRegressionClassifier<Scalar, Label>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: LogisticRegressionClassifierModel<number, SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> LogisticRegressionClassifier<Scalar, Label>.Transformer
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: LogisticRegressionClassifierModel<number, SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: LogisticRegressionClassifier<Scalar, Label>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: LogisticRegressionClassifierModel<number, SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> LogisticRegressionClassifierModel<Scalar, Label>
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: LogisticRegressionClassifierModel<number, SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: LogisticRegressionClassifierModel<Scalar, Label>, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+preprocessed
TypeScriptpreprocessed(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<_TabularData_DataFrame>
Swift declarationfunc preprocessed(from input: DataFrame, eventHandler: EventHandler? = nil) async throws -> DataFrame
Preprocesses a data frame of examples.
- Parameters:
- input: A data frame of examples.
- eventHandler: An event handler.
- Returns: The preprocessed examples.
get · iOS 17.0+preprocessor
TypeScriptget preprocessor(): TreeRegressorModel
Swift declarationvar preprocessor: Preprocessor
The preprocessing transformer.
set · iOS 17.0+preprocessor
TypeScriptset preprocessor(value: TreeRegressorModel)
Swift declarationvar preprocessor: Preprocessor
The preprocessing transformer.
method · iOS 17.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTabularTransformer<TreeRegressorModel, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingTabularEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encode
TypeScriptencode(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingTabularEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+fitted
TypeScriptfittedToPreprocessedEventHandler(preprocessed: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<ComposedTabularTransformer<TreeRegressorModel, unknown>>
Swift declarationfunc fitted(toPreprocessed preprocessed: DataFrame, eventHandler: EventHandler? = nil) async throws -> PreprocessingTabularEstimator<Preprocessor, Estimator>.Transformer
Fits a transformer to a data frame of preprocessed features.
- Parameters:
- preprocessed: A data frame of preprocessed features.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 17.0+fitted
TypeScriptfittedToEventHandler(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<ComposedTabularTransformer<TreeRegressorModel, unknown>>
Swift declarationfunc fitted(to input: DataFrame, eventHandler: EventHandler? = nil) async throws -> PreprocessingTabularEstimator<Preprocessor, Estimator>.Transformer
Fits a composed transformer to a data frame of examples.
- Parameters:
- input: A data frame of examples.
- eventHandler: An event handler.
- Returns: The fitted transformer.
get · iOS 17.0+range
TypeScriptget range(): SDKHandle
Swift declarationfinal var range: Range<Parameter>
The range of a random number to use as input to the transformer.
set · iOS 17.0+range
TypeScriptset range(value: SDKHandle)
Swift declarationfinal var range: Range<Parameter>
The range of a random number to use as input to the transformer.
get · iOS 17.0+transformer
TypeScriptget transformer(): RandomImageCropper
Swift declarationlet transformer: RandomTransformer
The transformation applied to each element.
get · iOS 16.0+configuration
TypeScriptget configuration(): FullyConnectedNetworkConfiguration
Swift declarationvar configuration: FullyConnectedNetworkConfiguration
The fully-connected-network configuration.
set · iOS 16.0+configuration
TypeScriptset configuration(value: FullyConnectedNetworkConfiguration)
Swift declarationvar configuration: FullyConnectedNetworkConfiguration
The fully-connected-network configuration.
init · iOS 16.0+init
TypeScriptstatic init(configuration?: FullyConnectedNetworkConfiguration): FullyConnectedNetworkRegressor<number>
Swift declarationinit(configuration: FullyConnectedNetworkConfiguration = .init())
Creates a fully connected network regressor.
- Parameter configuration: The configuration.
method · iOS 16.0+makeTransformer
TypeScriptmakeTransformer(): FullyConnectedNetworkRegressorModel<number>
Swift declarationfunc makeTransformer() -> FullyConnectedNetworkRegressorModel<Scalar>
Creates a default-initialized fully connected network regressor model suitable for incremental fitting.
method · iOS 16.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: FullyConnectedNetworkRegressorModel<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> FullyConnectedNetworkRegressor<Scalar>.Transformer
Decodes a previously fitted transformer with an optimizer.
- Parameter decoder: A decoder for the estimator.
- Returns: A fully connected network regressor model.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: FullyConnectedNetworkRegressorModel<number>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: FullyConnectedNetworkRegressor<Scalar>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer with an optimizer.
- Parameters:
- transformer: A fully connected network regressor model.
- encoder: An encoder for the estimator.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: FullyConnectedNetworkRegressorModel<number>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> FullyConnectedNetworkRegressorModel<Scalar>
Decodes the estimator.
- Parameter decoder: A decoder for the estimator.
- Returns: A fully connected network regressor model.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+fitted
TypeScriptfittedToValidateOnEventHandler(input: Array<AnnotatedFeature<SDKHandle, number>>, validation: Array<AnnotatedFeature<SDKHandle, number>>, eventHandler?: (((arg0: Event) => void)) | null): Promise<FullyConnectedNetworkRegressorModel<number>>
Swift declarationfunc fitted<Input, Validation>(to input: Input, validateOn validation: Validation, eventHandler: EventHandler? = nil) async throws -> FullyConnectedNetworkRegressorModel<Scalar> where Input : Sequence, Validation : Sequence, Input.Element == AnnotatedFeature<MLShapedArray<Scalar>, Float>, Validation.Element == AnnotatedFeature<MLShapedArray<Scalar>, Float>
Fits a fully connected network regressor model to a sequence of examples.
The training process partitions the input into random batches according to the batch size configuration
parameter. Training stops when the validation loss stops improving or when the maximum number of iterations
is reached.
- Parameters:
- input: A sequence of examples used for fitting the regressor.
- validation: A sequence of examples used for validating the fitted regressor.
- eventHandler: An event handler.
- Returns: The fitted fully connected network regressor model.
method · iOS 16.0+fitted
TypeScriptfittedToEventHandler(input: Array<AnnotatedFeature<SDKHandle, number>>, eventHandler?: (((arg0: Event) => void)) | null): Promise<FullyConnectedNetworkRegressorModel<number>>
Swift declarationfunc fitted<Input>(to input: Input, eventHandler: EventHandler? = nil) async throws -> FullyConnectedNetworkRegressor<Scalar>.Transformer where Input : Sequence, Input.Element == AnnotatedFeature<MLShapedArray<Scalar>, Float>
Fits a fully connected network regressor model to a sequence of examples.
The training process partitions the input into random batches according to the batch size configuration
parameter. Training stops when the maximum number of iterations is reached.
- Note: This method does not do early-stopping, using a high value for `maximumIterations` may lead to
over-fitting. Consider providing a validation set.
- Parameters:
- input: A sequence of examples used for fitting the transformer.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 16.0+update
TypeScriptupdate(transformer: FullyConnectedNetworkRegressorModel<number>, input: Array<AnnotatedFeature<SDKHandle, number>>, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": FullyConnectedNetworkRegressorModel<number> } }>
Swift declarationfunc update<InputSequence>(_ transformer: inout FullyConnectedNetworkRegressorModel<Scalar>, with input: InputSequence, eventHandler: EventHandler? = nil) async throws where InputSequence : Sequence, InputSequence.Element == AnnotatedFeature<MLShapedArray<Scalar>, Float>
Updates a fully connected network regressor model with a new sequence of examples.
- Parameters:
- transformer: A fully connected network regressor model to update.
- input: A sequence of examples.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTemporalTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingTemporalEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: ComposedTemporalTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingTemporalEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 16.0+configuration
TypeScriptget configuration(): FullyConnectedNetworkConfiguration
Swift declarationvar configuration: FullyConnectedNetworkConfiguration
The fully-connected-network configuration.
set · iOS 16.0+configuration
TypeScriptset configuration(value: FullyConnectedNetworkConfiguration)
Swift declarationvar configuration: FullyConnectedNetworkConfiguration
The fully-connected-network configuration.
method · iOS 16.0+makeTransformer
TypeScriptmakeTransformer(): FullyConnectedNetworkClassifierModel<number, SDKHandle>
Swift declarationfunc makeTransformer() -> FullyConnectedNetworkClassifierModel<Scalar, Label>
Creates a default-initialized fully connected network classifier model suitable for incremental fitting.
method · iOS 16.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: FullyConnectedNetworkClassifierModel<number, SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> FullyConnectedNetworkClassifier<Scalar, Label>.Transformer
Decodes a previously fitted transformer with an optimizer.
- Parameter decoder: A decoder for the estimator.
- Returns: A fully connected network classifier model.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: FullyConnectedNetworkClassifierModel<number, SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: FullyConnectedNetworkClassifier<Scalar, Label>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer with an optimizer.
- Parameters:
- transformer: A fully connected network classifier model.
- encoder: An encoder for the estimator.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: FullyConnectedNetworkClassifierModel<number, SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> FullyConnectedNetworkClassifierModel<Scalar, Label>
Decodes the estimator.
- Parameter decoder: A decoder for the estimator.
- Returns: A fully connected network classifier model.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+recallScore
TypeScriptrecallScore(label: number): number
Swift declarationfunc recallScore(for label: Label) -> Float
Computes the recall score for a class label.
Recall score is computed as the ratio `truePositive / (truePositive + falseNegative)`.
- Parameter label: The label to use as true positive.
- Returns: The recall score for the given label.
get · iOS 17.0+exampleCount
TypeScriptget exampleCount(): number
Swift declarationvar exampleCount: Int { get }
The number of examples used to compute the metrics.
method · iOS 17.0+precisionScore
TypeScriptprecisionScore(label: number): number
Swift declarationfunc precisionScore(for label: Label) -> Float
Computes the precision score for a class label.
Precision score is computed as the ratio `truePositive / (truePositive + falsePositive)`.
- Parameter label: The label to use as true positive.
- Returns: The precision score for the given label.
method · iOS 17.0+trueNegativeCount
TypeScripttrueNegativeCount(label: number): number
Swift declarationfunc trueNegativeCount(of label: Label) -> Int
Returns the number of times a label was not in the predicted or ground truth collections.
If the label does not have a confidence threshold, the true negative count is 0. If the label has a
confidence threshold NaN, the true negative count is the number elements in the ground truth collection that
do not contain the label. If the label is not in the known set of labels, the true negative count is 0.
- Parameter label: The label to use as true positive.
- Returns: The true negative count.
method · iOS 17.0+truePositiveCount
TypeScripttruePositiveCount(label: number): number
Swift declarationfunc truePositiveCount(of label: Label) -> Int
Returns the number of times the predicted label matched the true label.
If the label does not have a confidence threshold, the true positive count is number of elements in the ground truth
labels collection that contains the label. If the label has a confidence threshold NaN, the true positive
count is 0. If the label is not in the known set of labels, the true positive count is 0.
- Parameter label: The label to use as true positive.
- Returns: The true positive count.
method · iOS 17.0+falseNegativeCount
TypeScriptfalseNegativeCount(label: number): number
Swift declarationfunc falseNegativeCount(of label: Label) -> Int
Returns the number of times a true label was not predicted.
If the label does not have a confidence threshold, the false negative count is 0. If the label has a
confidence threshold NaN, the false negative count is the number of elements in the ground truth labels
collection that do not contain the label. If the label is not in the known set of labels, the false negative count is 0.
- Parameter label: The label to use as true positive.
- Returns: The false negative count.
method · iOS 17.0+falsePositiveCount
TypeScriptfalsePositiveCount(label: number): number
Swift declarationfunc falsePositiveCount(of label: Label) -> Int
Returns the number of times the predicted label did not match the true label.
If the label does not have a confidence threshold, the false positive count is the number of elements in the
ground truth labels collection that do not contain the label. If the label has a confidence threshold NaN, the
false positive count is 0. If the label is not in the known set of labels, the false positive count is 0.
- Parameter label: The label to use as true positive.
- Returns: The false positive count.
init · iOS 17.0+init
TypeScriptstatic init(confidenceThresholds: Record<number, number>): MultiLabelClassificationMetrics<number>
Swift declarationinit(confidenceThresholds: [Label : Float])
Creates empty multi-label classification metrics.
- Parameter confidenceThresholds: A dictionary of label and confidence thresholds.
get · iOS 17.0+confidenceThresholds
TypeScriptget confidenceThresholds(): Record<number, number>
Swift declarationvar confidenceThresholds: [Label : Float] { get }
A dictionary of label and confidence thresholds.
get · iOS 17.0+meanAveragePrecision
TypeScriptget meanAveragePrecision(): number
Swift declarationvar meanAveragePrecision: Float { get }
The mean average precision.
An average precision score summarizes the precision-recall curve for a label.
The mean average precision is the mean of the average precision scores for all the classification labels.
method · iOS 17.0+count
TypeScriptcount(label: number): number
Swift declarationfunc count(of label: Label) -> Int
Returns the number of times a label appeared in the ground truth collection.
- Parameter label: The label.
get · iOS 17.0+labels
TypeScriptget labels(): Array<number>
Swift declarationvar labels: Set<Label> { get }
The classifier labels.
method · iOS 17.0+f1Score
TypeScriptf1Score(label: number): number
Swift declarationfunc f1Score(for label: Label) -> Float
Computes the F1 score from predicted and ground truth values.
The balanced F-score, or F1 score, is computed as the harmonic mean of the precision and recall.
If the provided label does not have a confidence threshold, the F1 score is NaN.
- Parameter label: The label to use as true positive.
- Returns: The F1 score for the given label.
method · iOS 16.0+makeTransformer
TypeScriptmakeTransformer(): ComposedTransformer<SDKHandle, unknown>
Swift declarationfunc makeTransformer() -> PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 16.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: ComposedTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer
Reads the encoded transformer and optimizer.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: ComposedTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: ComposedTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingSupervisedEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: ComposedTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingSupervisedEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 17.0+coefficients
TypeScriptget coefficients(): Array<number>
Swift declarationvar coefficients: [Scalar] { get }
The linear coefficients.
get · iOS 17.0+featureCount
TypeScriptget featureCount(): number
Swift declarationvar featureCount: Int { get }
The number of features expected in the input.
method · iOS 16.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<ClassificationDistribution<SDKHandle>>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> ClassificationDistribution<Label>
Performs a classification on a single input.
- Parameters:
- input: The classifier input.
- eventHandler: An event handler.
- Returns: A classification distribution.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 16.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<number>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> FullyConnectedNetworkRegressorModel<Scalar>.Target
Performs regression on a shaped array.
- Parameters:
- input: The regressor input.
- eventHandler: An event handler.
- Returns: A regression.
get · iOS 16.0+annotationColumnID
TypeScriptget annotationColumnID(): _TabularData_ColumnID<unknown>
Swift declarationvar annotationColumnID: ColumnID<Annotation>
The annotation column identifier.
set · iOS 16.0+annotationColumnID
TypeScriptset annotationColumnID(value: _TabularData_ColumnID<unknown>)
Swift declarationvar annotationColumnID: ColumnID<Annotation>
The annotation column identifier.
get · iOS 17.0+range
TypeScriptget range(): SDKHandle
Swift declarationvar range: ClosedRange<Parameter>
The range of a random number to use as input to the transformer.
set · iOS 17.0+range
TypeScriptset range(value: SDKHandle)
Swift declarationvar range: ClosedRange<Parameter>
The range of a random number to use as input to the transformer.
method · iOS 16.0+ · Deprecated in iOS 18.0makeTransformer
TypeScriptmakeTransformer(): TransformerToTemporalAdaptor<SDKHandle>
Swift declarationfunc makeTransformer() -> UpdatableEstimatorToTemporalAdaptor<Base>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 16.0+ · Deprecated in iOS 18.0decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: TransformerToTemporalAdaptor<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> UpdatableEstimatorToTemporalAdaptor<Base>.Transformer
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: TransformerToTemporalAdaptor<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: UpdatableEstimatorToTemporalAdaptor<Base>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer created by this estimator.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: TransformerToTemporalAdaptor<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> UpdatableEstimatorToTemporalAdaptor<Base>.Transformer
Decodes the transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: TransformerToTemporalAdaptor<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: UpdatableEstimatorToTemporalAdaptor<Base>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 16.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): Promise<ClassificationDistribution<SDKHandle>>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> ClassificationDistribution<Label>
Performs a classification on a shaped array.
- Parameters:
- input: The classifier input.
- eventHandler: An event handler.
- Returns: A classification distribution.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: TransformerToTemporalAdaptor<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> SupervisedEstimatorToTemporalAdaptor<Base>.Transformer
Decodes the transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: TransformerToTemporalAdaptor<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: SupervisedEstimatorToTemporalAdaptor<Base>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 16.0+transformer
TypeScriptget transformer(): TreeRegressorModel
Swift declarationlet transformer: Transformer
A pre-defined tabular transformer.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: TreeRegressorModel; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> Transformer
Returns the pre-defined tabular transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: TreeRegressorModel, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: Transformer, to encoder: inout any EstimatorEncoder) throws
Does nothing since this tabular estimator uses a pre-defined tabular transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+fitted
TypeScriptfitted(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<TreeRegressorModel>
Swift declarationfunc fitted(to input: DataFrame, eventHandler: EventHandler? = nil) async throws -> Transformer
Returns the pre-defined tabular transformer.
- Parameters:
- input: A data frame.
- eventHandler: An event handler.
- Returns: The pre-defined tabular transformer.
init · iOS 16.0+init
TypeScriptstatic init(transformer: TreeRegressorModel): TabularTransformerToEstimatorAdaptor<TreeRegressorModel>
Swift declarationinit(_ transformer: Transformer)
Creates a trivial tabular estimator.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: unknown; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> TemporalEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Returns the pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: unknown, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: TemporalEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to encoder: inout any EstimatorEncoder) throws
Does nothing since this estimator uses a pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 18.0+annotations
TypeScriptget annotations(): _CoreML_MLShapedArray<number>
Swift declarationlet annotations: MLShapedArray<Scalar>
The original annotations.
method · iOS 18.0+makeIterator
TypeScriptmakeIterator(): TimeSeriesForecasterAnnotatedWindows_Iterator<number>
Swift declarationfunc makeIterator() -> TimeSeriesForecasterAnnotatedWindows<Scalar>.Iterator
Returns an iterator over the elements of this sequence.
get · iOS 18.0+inputWindowSize
TypeScriptget inputWindowSize(): number
Swift declarationlet inputWindowSize: Int
The input sample count.
get · iOS 18.0+shufflesElements
TypeScriptget shufflesElements(): boolean
Swift declarationvar shufflesElements: Bool
A Boolean value indicating whether to shuffle the elements.
set · iOS 18.0+shufflesElements
TypeScriptset shufflesElements(value: boolean)
Swift declarationvar shufflesElements: Bool
A Boolean value indicating whether to shuffle the elements.
get · iOS 18.0+forecastWindowSize
TypeScriptget forecastWindowSize(): number
Swift declarationlet forecastWindowSize: Int
The prediction sample count.
get · iOS 18.0+underestimatedCount
TypeScriptget underestimatedCount(): number
Swift declarationvar underestimatedCount: Int { get }
A value less than or equal to the number of elements in the sequence,
calculated nondestructively.
The default implementation returns 0. If you provide your own
implementation, make sure to compute the value nondestructively.
- Complexity: O(1), except if the sequence also conforms to `Collection`.
In this case, see the documentation of `Collection.underestimatedCount`.
get · iOS 18.0+stride
TypeScriptget stride(): number
Swift declarationvar stride: Int
The number of samples between windows.
set · iOS 18.0+stride
TypeScriptset stride(value: number)
Swift declarationvar stride: Int
The number of samples between windows.
method · iOS 18.0+next
TypeScriptnext(): (AnnotatedFeature<_CoreML_MLShapedArray<number>, _CoreML_MLShapedArray<number>>) | null
Swift declarationmutating func next() -> AnnotatedFeature<MLShapedArray<Scalar>, MLShapedArray<Scalar>>?
Advances to the next element and returns it, or `nil` if no next element
exists.
Repeatedly calling this method returns, in order, all the elements of the
underlying sequence. As soon as the sequence has run out of elements, all
subsequent calls return `nil`.
You must not call this method if any other copy of this iterator has been
advanced with a call to its `next()` method.
The following example shows how an iterator can be used explicitly to
emulate a `for`-`in` loop. First, retrieve a sequence's iterator, and
then call the iterator's `next()` method until it returns `nil`.
let numbers = [2, 3, 5, 7]
var numbersIterator = numbers.makeIterator()
while let num = numbersIterator.next() {
print(num)
}
// Prints "2"
// Prints "3"
// Prints "5"
// Prints "7"
- Returns: The next element in the underlying sequence, if a next element
exists; otherwise, `nil`.
init · iOS 18.0+init
TypeScriptstatic init(features: _CoreML_MLShapedArray<number>, annotations: _CoreML_MLShapedArray<number>, inputWindowSize: number, forecastWindowSize: number, stride?: number, shufflesElements?: boolean): TimeSeriesForecasterAnnotatedWindows<number>
Swift declarationinit(features: MLShapedArray<Scalar>, annotations: MLShapedArray<Scalar>, inputWindowSize: Int, forecastWindowSize: Int, stride: Int = 1, shufflesElements: Bool = true) throws
Creates a batch sequence.
- Parameters:
- features: A shaped array of features, it must have two dimensions.
- annotations: A shaped array of annotations, it must have two dimensions.
- inputWindowSize: The number of input samples. Must be positive.
- forecastWindowSize: The number of prediction samples. Must be positive.
- stride: The number of samples between windows. Must be positive. Defaults to 1.
- shufflesElements: A Boolean value indicating whether to shuffle the elements. Defaults to true.
get · iOS 18.0+features
TypeScriptget features(): _CoreML_MLShapedArray<number>
Swift declarationlet features: MLShapedArray<Scalar>
The original features.
get · iOS 16.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 16.0+filePathType
TypeScriptget filePathType(): DataFrameTemporalAnnotationParameters_FilePathType<number>
Swift declarationvar filePathType: DataFrameTemporalAnnotationParameters<Annotation>.FilePathType
The file path type in the annotation file. The default value is `.absolute`.
set · iOS 16.0+filePathType
TypeScriptset filePathType(value: DataFrameTemporalAnnotationParameters_FilePathType<number>)
Swift declarationvar filePathType: DataFrameTemporalAnnotationParameters<Annotation>.FilePathType
The file path type in the annotation file. The default value is `.absolute`.
get · iOS 16.0+endTimeColumnID
TypeScriptget endTimeColumnID(): (_TabularData_ColumnID<number>) | null
Swift declarationvar endTimeColumnID: ColumnID<Double>?
The column id that contains the end time. The default value is `nil`.
set · iOS 16.0+endTimeColumnID
TypeScriptset endTimeColumnID(value: (_TabularData_ColumnID<number>) | null)
Swift declarationvar endTimeColumnID: ColumnID<Double>?
The column id that contains the end time. The default value is `nil`.
get · iOS 16.0+filePathColumnID
TypeScriptget filePathColumnID(): _TabularData_ColumnID<string>
Swift declarationvar filePathColumnID: ColumnID<String>
The column id that contains the file path. The default value is "filePath" with String type.
set · iOS 16.0+filePathColumnID
TypeScriptset filePathColumnID(value: _TabularData_ColumnID<string>)
Swift declarationvar filePathColumnID: ColumnID<String>
The column id that contains the file path. The default value is "filePath" with String type.
get · iOS 16.0+startTimeColumnID
TypeScriptget startTimeColumnID(): (_TabularData_ColumnID<number>) | null
Swift declarationvar startTimeColumnID: ColumnID<Double>?
The column id that contains the start time. The default value is `nil`.
set · iOS 16.0+startTimeColumnID
TypeScriptset startTimeColumnID(value: (_TabularData_ColumnID<number>) | null)
Swift declarationvar startTimeColumnID: ColumnID<Double>?
The column id that contains the start time. The default value is `nil`.
get · iOS 16.0+annotationColumnID
TypeScriptget annotationColumnID(): _TabularData_ColumnID<number>
Swift declarationvar annotationColumnID: ColumnID<Annotation>
The column id that contains the annotation. The default value is "annotation" with `Annotation` type.
set · iOS 16.0+annotationColumnID
TypeScriptset annotationColumnID(value: _TabularData_ColumnID<number>)
Swift declarationvar annotationColumnID: ColumnID<Annotation>
The column id that contains the annotation. The default value is "annotation" with `Annotation` type.
init · iOS 16.0+init
TypeScriptstatic init(): DataFrameTemporalAnnotationParameters<number>
Swift declarationinit()
Creates a DataFrameTemporalAnnotationParameters by using default options.
method · iOS 16.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: unknown; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> UpdatableEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Reads the encoded transformer and optimizer.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: unknown, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: UpdatableEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer created by this estimator.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: unknown; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> UpdatableEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Returns the pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: unknown, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: UpdatableEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to encoder: inout any EstimatorEncoder) throws
Does nothing since this estimator uses a pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+preprocessed
TypeScriptpreprocessed(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<_TabularData_DataFrame>
Swift declarationfunc preprocessed(from input: DataFrame, eventHandler: EventHandler? = nil) async throws -> DataFrame
Preprocesses a data frame of examples.
- Parameters:
- input: A data frame of examples.
- eventHandler: An event handler.
- Returns: The preprocessed examples.
get · iOS 17.0+preprocessor
TypeScriptget preprocessor(): TreeRegressorModel
Swift declarationvar preprocessor: Preprocessor
The preprocessing transformer.
set · iOS 17.0+preprocessor
TypeScriptset preprocessor(value: TreeRegressorModel)
Swift declarationvar preprocessor: Preprocessor
The preprocessing transformer.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): ComposedTabularTransformer<TreeRegressorModel, unknown>
Swift declarationfunc makeTransformer() -> PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: ComposedTabularTransformer<TreeRegressorModel, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer
Reads the encoded transformer and optimizer.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTabularTransformer<TreeRegressorModel, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encode
TypeScriptencode(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+fitted
TypeScriptfittedToPreprocessedEventHandler(preprocessed: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<ComposedTabularTransformer<TreeRegressorModel, unknown>>
Swift declarationfunc fitted(toPreprocessed preprocessed: DataFrame, eventHandler: EventHandler? = nil) async throws -> PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer
Fits a transformer to a data frame of preprocessed features.
- Parameters:
- preprocessed: A data frame of preprocessed features.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 17.0+fitted
TypeScriptfittedToEventHandler(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<ComposedTabularTransformer<TreeRegressorModel, unknown>>
Swift declarationfunc fitted(to input: DataFrame, eventHandler: EventHandler? = nil) async throws -> PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer
Fits a composed transformer to a data frame of examples.
- Parameters:
- input: A data frame of examples.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 17.0+update
TypeScriptupdateWithPreprocessedEventHandler(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, preprocessed: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": ComposedTabularTransformer<TreeRegressorModel, unknown> } }>
Swift declarationfunc update(_ transformer: inout PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer, withPreprocessed preprocessed: DataFrame, eventHandler: EventHandler? = nil) async throws
Updates a transformer with a new data frame of preprocessed features.
- Parameters:
- transformer: A transformer to update.
- preprocessed: A data frame of preprocessed features.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
method · iOS 17.0+update
TypeScriptupdateWithEventHandler(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": ComposedTabularTransformer<TreeRegressorModel, unknown> } }>
Swift declarationfunc update(_ transformer: inout PreprocessingUpdatableTabularEstimator<Preprocessor, Estimator>.Transformer, with input: DataFrame, eventHandler: EventHandler? = nil) async throws
Updates a transformer with a new data frame of examples.
- Parameters:
- transformer: A transformer to update.
- input: A data frame of examples.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
method · iOS 17.0+preprocessed
TypeScriptpreprocessed(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<_TabularData_DataFrame>
Swift declarationfunc preprocessed(from input: DataFrame, eventHandler: EventHandler? = nil) async throws -> DataFrame
Preprocesses a data frame of examples.
- Parameters:
- input: A data frame of examples.
- eventHandler: An event handler.
- Returns: The preprocessed examples.
get · iOS 17.0+preprocessor
TypeScriptget preprocessor(): TreeRegressorModel
Swift declarationvar preprocessor: Preprocessor
The preprocessing transformer.
set · iOS 17.0+preprocessor
TypeScriptset preprocessor(value: TreeRegressorModel)
Swift declarationvar preprocessor: Preprocessor
The preprocessing transformer.
method · iOS 17.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTabularTransformer<TreeRegressorModel, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encode
TypeScriptencode(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+fitted
TypeScriptfittedToPreprocessedValidateOnEventHandler(preprocessedInput: _TabularData_DataFrame, preprocessedValidation?: (_TabularData_DataFrame) | null, eventHandler?: (((arg0: Event) => void)) | null): Promise<ComposedTabularTransformer<TreeRegressorModel, unknown>>
Swift declarationfunc fitted(toPreprocessed preprocessedInput: DataFrame, validateOn preprocessedValidation: DataFrame?, eventHandler: EventHandler? = nil) async throws -> PreprocessingSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
Fits a transformer to a data frame of preprocessed examples while validating.
- Parameters:
- preprocessedInput: A data frame of preprocessed features used for fitting the transformer.
- preprocessedValidation: A data frame of preprocessed features used for validating the fitted transformer.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 17.0+fitted
TypeScriptfittedToValidateOnEventHandler(input: _TabularData_DataFrame, validation?: (_TabularData_DataFrame) | null, eventHandler?: (((arg0: Event) => void)) | null): Promise<ComposedTabularTransformer<TreeRegressorModel, unknown>>
Swift declarationfunc fitted(to input: DataFrame, validateOn validation: DataFrame?, eventHandler: EventHandler? = nil) async throws -> PreprocessingSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
Fits a transformer to a data frame
- Parameters:
- input: A data frame containing examples used for fitting the transformer.
- validation: A data frame containing examples used for validating the fitted transformer.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 16.0+ · Deprecated in iOS 18.0makeTransformer
TypeScriptmakeTransformer(): ComposedTemporalTransformer<SDKHandle, unknown>
Swift declarationfunc makeTransformer() -> PreprocessingUpdatableTemporalEstimator<Preprocessor, Estimator>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 16.0+ · Deprecated in iOS 18.0decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: ComposedTemporalTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableTemporalEstimator<Preprocessor, Estimator>.Transformer
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: ComposedTemporalTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: PreprocessingUpdatableTemporalEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTemporalTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableTemporalEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: ComposedTemporalTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingUpdatableTemporalEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTemporalTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingSupervisedTemporalEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: ComposedTemporalTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingSupervisedTemporalEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 17.0+configuration
TypeScriptget configuration(): FullyConnectedNetworkConfiguration
Swift declarationvar configuration: FullyConnectedNetworkConfiguration
The fully-connected network configuration.
set · iOS 17.0+configuration
TypeScriptset configuration(value: FullyConnectedNetworkConfiguration)
Swift declarationvar configuration: FullyConnectedNetworkConfiguration
The fully-connected network configuration.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): FullyConnectedNetworkMultiLabelClassifierModel<number, SDKHandle>
Swift declarationfunc makeTransformer() -> FullyConnectedNetworkMultiLabelClassifierModel<Scalar, Label>
Creates a default-initialized fully-connected network multi-label classifier model suitable for incremental fitting.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: FullyConnectedNetworkMultiLabelClassifierModel<number, SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> FullyConnectedNetworkMultiLabelClassifier<Scalar, Label>.Transformer
Decodes a previously fitted transformer with an optimizer.
- Parameter decoder: A decoder for the estimator.
- Returns: A fully-connected network multi-label classifier model.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: FullyConnectedNetworkMultiLabelClassifierModel<number, SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: FullyConnectedNetworkMultiLabelClassifier<Scalar, Label>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer with an optimizer.
- Parameters:
- transformer: A fully-connected network multi-label classifier model.
- encoder: An encoder for the estimator.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: FullyConnectedNetworkMultiLabelClassifierModel<number, SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> FullyConnectedNetworkMultiLabelClassifierModel<Scalar, Label>
Decodes the estimator.
- Parameter decoder: A decoder for the estimator.
- Returns: A fully-connected network multi-label classifier model.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+makeTransformer
TypeScriptmakeTransformer(): ComposedTransformer<SDKHandle, unknown>
Swift declarationfunc makeTransformer() -> PreprocessingUpdatableSupervisedEstimator<Preprocessor, Estimator>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 16.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: ComposedTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableSupervisedEstimator<Preprocessor, Estimator>.Transformer
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: ComposedTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: PreprocessingUpdatableSupervisedEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableSupervisedEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: ComposedTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingUpdatableSupervisedEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 16.0+annotationColumnID
TypeScriptget annotationColumnID(): _TabularData_ColumnID<number>
Swift declarationvar annotationColumnID: ColumnID<Annotation>
The annotation column identifier.
set · iOS 16.0+annotationColumnID
TypeScriptset annotationColumnID(value: _TabularData_ColumnID<number>)
Swift declarationvar annotationColumnID: ColumnID<Annotation>
The annotation column identifier.
method · iOS 16.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: unknown; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> UpdatableTabularEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Reads the encoded transformer and optimizer.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: unknown, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: UpdatableTabularEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer created by this estimator.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: unknown; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> UpdatableTabularEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Returns the pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: unknown, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: UpdatableTabularEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to encoder: inout any EstimatorEncoder) throws
Does nothing since this estimator uses a pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+fitted
TypeScriptfitted(input: _TabularData_DataFrame, validation?: (_TabularData_DataFrame) | null, eventHandler?: (((arg0: Event) => void)) | null): Promise<unknown>
Swift declarationfunc fitted(to input: DataFrame, validateOn validation: DataFrame?, eventHandler: EventHandler? = nil) async throws -> UpdatableTabularEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Fits a transformer to a data frame.
- Parameters:
- input: A data frame containing examples used for fitting the transformer.
- validation: A data frame containing examples used for validating the fitted transformer.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 16.0+update
TypeScriptupdate(transformer: unknown, input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": unknown } }>
Swift declarationfunc update(_ transformer: inout UpdatableTabularEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, with input: DataFrame, eventHandler: EventHandler? = nil) async throws
Updates a transformer with a new data frame containing examples.
- Parameters:
- transformer: A transformer to update.
- input: A sequence of examples.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
method · iOS 16.0+makeTransformer
TypeScriptmakeTransformer(): TreeRegressorModel
Swift declarationfunc makeTransformer() -> Transformer
Creates a default-initialized transformer suitable for incremental fitting.
get · iOS 16.0+transformer
TypeScriptget transformer(): TreeRegressorModel
Swift declarationlet transformer: Transformer
A pre-defined transformer.
method · iOS 16.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: TreeRegressorModel; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> Transformer
Returns the pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: TreeRegressorModel, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: Transformer, to encoder: inout any EstimatorEncoder) throws
Does nothing since this estimator uses a pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: TreeRegressorModel; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> Transformer
Returns the pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+encode
TypeScriptencode(transformer: TreeRegressorModel, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: Transformer, to encoder: inout any EstimatorEncoder) throws
Does nothing since this estimator uses a pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+fitted
TypeScriptfitted(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<TreeRegressorModel>
Swift declarationfunc fitted(to input: DataFrame, eventHandler: EventHandler? = nil) async throws -> Transformer
Returns the pre-defined transformer.
- Parameters:
- input: A data frame containing examples.
- eventHandler: An event handler.
- Returns: The pre-defined transformer.
method · iOS 16.0+update
TypeScriptupdate(transformer: TreeRegressorModel, input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": TreeRegressorModel } }>
Swift declarationfunc update(_ transformer: inout Transformer, with input: DataFrame, eventHandler: EventHandler? = nil) async throws
Does nothing since this estimator uses a pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
init · iOS 16.0+init
TypeScriptstatic init(transformer: TreeRegressorModel): TabularTransformerToUpdatableEstimatorAdaptor<TreeRegressorModel>
Swift declarationinit(_ transformer: Transformer)
Creates an updatable tabular estimator from a tabular transformer.
method · iOS 16.0+ · Deprecated in iOS 18.0makeTransformer
TypeScriptmakeTransformer(): TransformerToTemporalAdaptor<SDKHandle>
Swift declarationfunc makeTransformer() -> UpdatableSupervisedEstimatorToTemporalAdaptor<Base>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 16.0+ · Deprecated in iOS 18.0decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: TransformerToTemporalAdaptor<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> UpdatableSupervisedEstimatorToTemporalAdaptor<Base>.Transformer
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: TransformerToTemporalAdaptor<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: UpdatableSupervisedEstimatorToTemporalAdaptor<Base>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: TransformerToTemporalAdaptor<SDKHandle>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> UpdatableSupervisedEstimatorToTemporalAdaptor<Base>.Transformer
Decodes the transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: TransformerToTemporalAdaptor<SDKHandle>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: UpdatableSupervisedEstimatorToTemporalAdaptor<Base>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: unknown; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> UpdatableTemporalEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: unknown, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: UpdatableTemporalEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: unknown; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> UpdatableTemporalEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer
Returns the pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: unknown, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: UpdatableTemporalEstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to encoder: inout any EstimatorEncoder) throws
Does nothing since this estimator uses a pre-defined transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 17.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 17.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<number>, eventHandler?: (((arg0: Event) => void)) | null): ClassificationDistribution<SDKHandle>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) throws -> ClassificationDistribution<Label>
Performs a classification on a shaped array.
- Parameters:
- input: The classifier input.
- eventHandler: An event handler.
- Returns: A classification distribution.
method · iOS 17.0+preprocessed
TypeScriptpreprocessed(input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<_TabularData_DataFrame>
Swift declarationfunc preprocessed(from input: DataFrame, eventHandler: EventHandler? = nil) async throws -> DataFrame
Preprocesses a data frame.
- Parameters:
- input: A data frame of examples.
- eventHandler: An event handler.
- Returns: The preprocessed examples.
get · iOS 17.0+preprocessor
TypeScriptget preprocessor(): TreeRegressorModel
Swift declarationvar preprocessor: Preprocessor
The preprocessing transformer.
set · iOS 17.0+preprocessor
TypeScriptset preprocessor(value: TreeRegressorModel)
Swift declarationvar preprocessor: Preprocessor
The preprocessing transformer.
method · iOS 17.0+makeTransformer
TypeScriptmakeTransformer(): ComposedTabularTransformer<TreeRegressorModel, unknown>
Swift declarationfunc makeTransformer() -> PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 17.0+decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: ComposedTabularTransformer<TreeRegressorModel, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTabularTransformer<TreeRegressorModel, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 17.0+encode
TypeScriptencode(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 17.0+fitted
TypeScriptfittedToPreprocessedValidateOnEventHandler(preprocessedInput: _TabularData_DataFrame, preprocessedValidation?: (_TabularData_DataFrame) | null, eventHandler?: (((arg0: Event) => void)) | null): Promise<ComposedTabularTransformer<TreeRegressorModel, unknown>>
Swift declarationfunc fitted(toPreprocessed preprocessedInput: DataFrame, validateOn preprocessedValidation: DataFrame?, eventHandler: EventHandler? = nil) async throws -> PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
Fits a composed transformer to a data frame of examples.
- Parameters:
- preprocessedInput: A data frame of preprocessed features used for fitting the transformer.
- preprocessedValidation: A data frame of preprocessed features used for validating the fitted transformer.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 17.0+fitted
TypeScriptfittedToValidateOnEventHandler(input: _TabularData_DataFrame, validation?: (_TabularData_DataFrame) | null, eventHandler?: (((arg0: Event) => void)) | null): Promise<ComposedTabularTransformer<TreeRegressorModel, unknown>>
Swift declarationfunc fitted(to input: DataFrame, validateOn validation: DataFrame?, eventHandler: EventHandler? = nil) async throws -> PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
Fits a composed transformer to a data frame of examples.
- Parameters:
- input: A data frame containing examples used for fitting the transformer.
- validation: A data frame containing examples used for validating the fitted transformer.
- eventHandler: An event handler.
- Returns: The fitted transformer.
method · iOS 17.0+update
TypeScriptupdateWithPreprocessedEventHandler(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, preprocessed: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": ComposedTabularTransformer<TreeRegressorModel, unknown> } }>
Swift declarationfunc update(_ transformer: inout PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer, withPreprocessed preprocessed: DataFrame, eventHandler: EventHandler? = nil) async throws
Updates a transformer with a new data frame of preprocessed features.
- Parameters:
- transformer: A transformer to update.
- preprocessed: A data frame of preprocessed features.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
method · iOS 17.0+update
TypeScriptupdateWithEventHandler(transformer: ComposedTabularTransformer<TreeRegressorModel, unknown>, input: _TabularData_DataFrame, eventHandler?: (((arg0: Event) => void)) | null): Promise<{ $ret: null; $out: { "transformer": ComposedTabularTransformer<TreeRegressorModel, unknown> } }>
Swift declarationfunc update(_ transformer: inout PreprocessingUpdatableSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer, with input: DataFrame, eventHandler: EventHandler? = nil) async throws
Updates a transformer with a new data frame of examples.
- Parameters:
- transformer: A transformer to update.
- input: A data frame of examples.
- eventHandler: An event handler.
Omit the output parameters from the call. The result contains $ret and $out, with transformer inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0makeTransformer
TypeScriptmakeTransformer(): ComposedTemporalTransformer<SDKHandle, unknown>
Swift declarationfunc makeTransformer() -> PreprocessingUpdatableSupervisedTemporalEstimator<Preprocessor, Estimator>.Transformer
Creates a default-initialized transformer suitable for incremental fitting.
method · iOS 16.0+ · Deprecated in iOS 18.0decodeWithOptimizer
TypeScriptdecodeWithOptimizer(decoder: SDKHandle): { $ret: ComposedTemporalTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decodeWithOptimizer(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableSupervisedTemporalEstimator<Preprocessor, Estimator>.Transformer
Reads the encoded transformer and optimizer with a decoder.
- Parameter decoder: A decoder.
- Returns: The decoded transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encodeWithOptimizer
TypeScriptencodeWithOptimizer(transformer: ComposedTemporalTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encodeWithOptimizer(_ transformer: PreprocessingUpdatableSupervisedTemporalEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes the transformer and optimizer to an encoder.
- Parameters:
- transformer: A transformer this estimator creates.
- encoder: An encoder.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0decode
TypeScriptdecode(decoder: SDKHandle): { $ret: ComposedTemporalTransformer<SDKHandle, unknown>; $out: { "decoder": SDKHandle } }
Swift declarationfunc decode(from decoder: inout any EstimatorDecoder) throws -> PreprocessingUpdatableSupervisedTemporalEstimator<Preprocessor, Estimator>.Transformer
Decodes a previously fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with decoder inside $out.
method · iOS 16.0+ · Deprecated in iOS 18.0encode
TypeScriptencode(transformer: ComposedTemporalTransformer<SDKHandle, unknown>, encoder: SDKHandle): { $ret: null; $out: { "encoder": SDKHandle } }
Swift declarationfunc encode(_ transformer: PreprocessingUpdatableSupervisedTemporalEstimator<Preprocessor, Estimator>.Transformer, to encoder: inout any EstimatorEncoder) throws
Encodes a fitted transformer.
Omit the output parameters from the call. The result contains $ret and $out, with encoder inside $out.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+shape
TypeScriptget shape(): Array<number>
Swift declarationvar shape: [Int]
The target shape.
set · iOS 16.0+shape
TypeScriptset shape(value: Array<number>)
Swift declarationvar shape: [Int]
The target shape.
method · iOS 16.0+applied
TypeScriptapplied(input: _CoreML_MLShapedArray<SDKHandle>, eventHandler?: (((arg0: Event) => void)) | null): _CoreML_MLShapedArray<SDKHandle>
Swift declarationfunc applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) throws -> MLShapedArray<Scalar>
Reshapes the input.
- Parameters:
- input: A shaped array.
- eventHandler: An event handler.
- Returns: A shaped array with the target shape.