<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLActivityClassifier/DataSource/directoryWithDataAndAnnotation(at:annotationFileName:timeStampColumn:labelStartTimeColumn:labelEndTimeColumn:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML20MLActivityClassifierV10DataSourceO013directoryWithE13AndAnnotationyAE10Foundation3URLV_S4StcAEmF"
  },
  "title" : "MLActivityClassifier.DataSource.directoryWithDataAndAnnotation(at:annotationFileName:timeStampColumn:labelStartTimeColumn:labelEndTimeColumn:)"
}
-->

# MLActivityClassifier.DataSource.directoryWithDataAndAnnotation(at:annotationFileName:timeStampColumn:labelStartTimeColumn:labelEndTimeColumn:)

An activity classifier data source that uses a directory that contains sensor data files and one annotation
file.

```
case directoryWithDataAndAnnotation(at: URL, annotationFileName: String, timeStampColumn: String, labelStartTimeColumn: String, labelEndTimeColumn: String)
```

## Parameters

`at`

The location URL of a directory in the file system that contains sensor data files and an activity
annotation file.

`annotationFileName`

The name of the activity annotation file.

`timeStampColumn`

The name of the column that contains the timestamps for each sensor data sample.

`labelStartTimeColumn`

The name of the column that contains the activity’s starting-time index in the
data file.

`labelEndTimeColumn`

The name of the column that contains the activity’s ending-time index in the data
file.

## Discussion

Create a data source by gathering all activity data files, and one annotation file, into a directory. Pass
that directory’s <doc://com.apple.documentation/documentation/Foundation/URL> and the relevant column names
of the annotation file to
[`MLActivityClassifier.DataSource.directoryWithDataAndAnnotation(at:annotationFileName:timeStampColumn:labelStartTimeColumn:labelEndTimeColumn:)`](/documentation/CreateML/MLActivityClassifier/DataSource/directoryWithDataAndAnnotation(at:annotationFileName:timeStampColumn:labelStartTimeColumn:labelEndTimeColumn:)).

---

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)