init(dictionary:)
Creates a batch provider based on feature names and their associated arrays of data.
Declaration
init(dictionary: [String : [Any]]) throwsParameters
- 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]])