Initializer

init(dictionary:)

Creates a batch provider based on feature names and their associated arrays of data.

Declaration

init(dictionary: [String : [Any]]) throws

Parameters

dictionary

A dictionary which maps feature names to an array of values. The error case occurs when all the arrays do not have the same length or the values in an aray are not expressible as an MLFeatureValue.

Discussion

This initializer is convenient when the data are available as individual arrays.

let batch = try  MLArrayBatchProvider(dictionary: ["age": [30, 35, 29],
                                                   "weightLbs": [120.0, 170.4, 213.6]])

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software