<!--
{
  "availability" : [
    "iOS: 15.0.0 - 17.0.0",
    "iPadOS: 15.0.0 - 17.0.0",
    "macCatalyst: 15.0.0 - 17.0.0",
    "macOS: 10.14.0 - 14.0.0",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLTextClassifier/DataSource/stratifiedSplit(proportions:seed:labelColumn:textColumn:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML16MLTextClassifierV10DataSourceO15stratifiedSplit11proportions4seed11labelColumn04textL0AA11MLDataTableVSaySdG_SiS2StKF"
  },
  "title" : "stratifiedSplit(proportions:seed:labelColumn:textColumn:)"
}
-->

# stratifiedSplit(proportions:seed:labelColumn:textColumn:)

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

```
func stratifiedSplit(proportions: [Double], seed: Int = timestampSeed(), labelColumn: String, textColumn: 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. The default value is the current epoch time in milliseconds.

`labelColumn`

The name of the column with the labels.

`textColumn`

The name of the column with the text data.

## Return Value

A new data table.

---

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)