---
title: "randomSplit(by:seed:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mldatatable/randomsplit(by:seed:)"
---

# randomSplit(by:seed:)

Creates two mutually exclusive, randomly divided subsets of the table.

## Declaration

```swift
func randomSplit(by proportion: Double, seed: Int = 1) -> (MLDataTable, MLDataTable)
```

## Parameters

- `proportion`: A value between 0.0 and 1.0 indicating the fraction of rows to go into one subset. The remaining rows go into the other subset.
- `seed`: A random number generator seed. The default value is 1.

## Mentioned in

Creating a word tagger model

## Return Value

Return Value Two new data tables.
