<!--
{
  "availability" : [
    "macOS: 10.15.0 - 14.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLActivityClassifier/DataSource/stratifiedSplit(proportions:seed:featureColumns:labelColumn:recordingFileColumn:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML20MLActivityClassifierV10DataSourceO15stratifiedSplit11proportions4seed14featureColumns11labelColumn013recordingFileN0AA11MLDataTableVSaySdG_SiSaySSGS2StKF"
  },
  "title" : "stratifiedSplit(proportions:seed:featureColumns:labelColumn:recordingFileColumn:)"
}
-->

# stratifiedSplit(proportions:seed:featureColumns:labelColumn:recordingFileColumn:)

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

```
func stratifiedSplit(proportions: [Double], seed: Int = timestampSeed(), featureColumns: [String], labelColumn: String, recordingFileColumn: String) throws -> MLDataTable
```

## Parameters

`proportions`

An array of proportions, each in the range `[0.0, 1.0]`.

`seed`

A seed number for the random-number generator.

`featureColumns`

The names of the feature columns the method includes in the data table.

`labelColumn`

The name of the label column the methods stratifies.

`recordingFileColumn`

The name of the column with the data file names.

## Return Value

A new [`MLDataTable`](/documentation/CreateML/MLDataTable) instance.

---

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)