---
title: "stratifiedSplitBySequence(proportions:by:on:seed:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mldatatable/stratifiedsplitbysequence(proportions:by:on:seed:)"
---

# stratifiedSplitBySequence(proportions:by:on:seed:)

Randomly split a MLDataTable into partitions on a user-define label column, while keeping rows from the same sequence in the original order.

## Declaration

```swift
func stratifiedSplitBySequence(proportions: [Double], by sequenceIdentifierColumn: String, 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.
- `sequenceIdentifierColumn`: The sequence identifier column in an MLDataTable to identify rows of a sequence.
- `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)
- [stratifiedSplit(proportions:on:seed:)](createml/mldatatable/stratifiedsplit(proportions:on:seed:).md)
- [stratifiedSplitBySequence(proportions:by:on:generator:)](createml/mldatatable/stratifiedsplitbysequence(proportions:by:on:generator:).md)
