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]])