<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLActionClassifier/DataSource",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML18MLActionClassifierV10DataSourceO"
  },
  "title" : "MLActionClassifier.DataSource"
}
-->

# MLActionClassifier.DataSource

A data source for an action classifier.

```
enum DataSource
```

## Topics

### Creating a data source

[`case labeledDirectories(at: URL)`](/documentation/CreateML/MLActionClassifier/DataSource/labeledDirectories(at:))

The location of a folder with subfolders each of which contain sample videos of an action.

[`case labeledFiles(at: URL)`](/documentation/CreateML/MLActionClassifier/DataSource/labeledFiles(at:))

The location of a folder that contains video files whose names you use to label corresponding actions.

[`case directoryWithVideosAndAnnotation(at: URL, annotationFile: URL, videoColumn: String, labelColumn: String, startTimeColumn: String?, endTimeColumn: String?)`](/documentation/CreateML/MLActionClassifier/DataSource/directoryWithVideosAndAnnotation(at:annotationFile:videoColumn:labelColumn:startTimeColumn:endTimeColumn:))

The location of a directory of video files, and the location of an action annotation file.

[`case labeledVideoData(table: MLDataTable, videoColumn: String, labelColumn: String, startTimeColumn: String?, endTimeColumn: String?)`](/documentation/CreateML/MLActionClassifier/DataSource/labeledVideoData(table:videoColumn:labelColumn:startTimeColumn:endTimeColumn:))

A data table that contains the locations of the video files and the action annotations.

### Extracting key points

[`func extractKeypoints(targetFrameRate: Double) throws -> DataFrame`](/documentation/CreateML/MLActionClassifier/DataSource/extractKeypoints(targetFrameRate:))

Extracts key points from video files if necessary.

[`case labeledKeypointsDataFrame(DataFrame, sessionIdColumn: String, labelColumn: String, featureColumn: String)`](/documentation/CreateML/MLActionClassifier/DataSource/labeledKeypointsDataFrame(_:sessionIdColumn:labelColumn:featureColumn:))

A data source made up of keypoints in a data frame.

[`case labeledKeypointsData(table: MLDataTable, sessionIdColumn: String, labelColumn: String, featureColumn: String)`](/documentation/CreateML/MLActionClassifier/DataSource/labeledKeypointsData(table:sessionIdColumn:labelColumn:featureColumn:))

A data table that contains the human body landmark movement data.

[`case labeledVideoDataFrame(DataFrame, videoColumn: String, labelColumn: String, startTimeColumn: String?, endTimeColumn: String?)`](/documentation/CreateML/MLActionClassifier/DataSource/labeledVideoDataFrame(_:videoColumn:labelColumn:startTimeColumn:endTimeColumn:))

A data source made up of video references in a data frame.

### Getting annotated file names

[`func gatherAnnotatedFileNames() throws -> DataFrame?`](/documentation/CreateML/MLActionClassifier/DataSource/gatherAnnotatedFileNames())

Processes the data source and returns a data frame that contains file URLs and annotations.

### Generating data tables from a data source

[`func videosWithAnnotations() throws -> MLDataTable`](/documentation/CreateML/MLActionClassifier/DataSource/videosWithAnnotations())

Generates a data table of the data source’s video URL locations and action annotations.

[`func keypointsWithAnnotations(targetFrameRate: Double) throws -> MLDataTable`](/documentation/CreateML/MLActionClassifier/DataSource/keypointsWithAnnotations(targetFrameRate:))

Generates a data table with action annotations of the data source.

[`func stratifiedSplit(proportions: [Double], seed: Int, labelColumn: String) throws -> MLDataTable`](/documentation/CreateML/MLActionClassifier/DataSource/stratifiedSplit(proportions:seed:labelColumn:))

Generates a data table by splitting the data source into strata.



---

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)