<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLActivityClassifier/predictions(from:perWindowPrediction:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML20MLActivityClassifierV11predictions4from19perWindowPredictionSaySSG11TabularData0K5FrameV_SbSgtKF::OverloadGroup"
  },
  "title" : "predictions(from:perWindowPrediction:)"
}
-->

# predictions(from:perWindowPrediction:)

Predict activities from new observations.

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

## Return Value

An array of predicted class names.

## Discussion

- Parameters
  - testingData: A data frame containing unlabeled sensor data samples. All samples are assumed to come from
    the same recording. Feature column names used in the table should be consistent with those used in training.
  - perWindowPrediction: A Boolean option to specify the prediction frequency. Default is false, and prediction
    is made per sample, instead of per window.

> Throws: `MLCreateError.type` if `testingData` format is invalid.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)