---
title: "stratifiedSplit(proportions:on:seed:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mldatatable/stratifiedsplit(proportions:on:seed:)"
---

# stratifiedSplit(proportions:on:seed:)

Randomly split a MLDataTable into a number partitions while stratifying on a user-define label column.

## Declaration

```swift
func stratifiedSplit(proportions: [Double], on column: String, seed: Int = timestampSeed()) throws -> MLDataTable
```

## Parameters

- `proportions`: An array of values on [0,1] specifying the proprtions in each partition. Automatically normalized to 1.
- `column`: The column in an MLDataTable being stratified on.
- `seed`: Seed for the random number generator used for splitting. The default seed is the current epoch time in milliseconds.

## Return Value

Return Value A new MLDataTable with an additional partition column with the index of the partition for each row.

## Discussion

Discussion The proportions specified will be applied uniformly to each label being partitioned on.

## See Also

### Splitting a data table

- [randomSplitBySequence(proportion:by:on:seed:)](createml/mldatatable/randomsplitbysequence(proportion:by:on:seed:).md)
- [stratifiedSplit(proportions:on:generator:)](createml/mldatatable/stratifiedsplit(proportions:on:generator:).md)
- [stratifiedSplitBySequence(proportions:by:on:generator:)](createml/mldatatable/stratifiedsplitbysequence(proportions:by:on:generator:).md)
- [stratifiedSplitBySequence(proportions:by:on:seed:)](createml/mldatatable/stratifiedsplitbysequence(proportions:by:on:seed:).md)
