Instance Method

predictions(from:perWindowPrediction:)

Classifies the given activities from the provided data table.

Declaration

func predictions(from data: MLDataTable, perWindowPrediction: Bool? = false) throws -> [String]

Parameters

data

The activity data you give the model to classify, contained in an MLDataTable.

perWindowPrediction

If true, the method returns one prediction per sample group size of predictionWindowSize rows. If false, the method returns one prediction per row.

Return Value

An array of activity prediction labels.

Discussion

The feature column names must be identical to the columns in the training data (noted by the featureColumns property). Otherwise this method throws an MLCreateError.type(reason:).