randomSplit(by:seed:)
Creates two mutually exclusive, randomly divided subsets of the table.
Declaration
func randomSplit(by proportion: Double, seed: Int = 1) -> (MLDataTable, MLDataTable)Parameters
- proportion:
A value between
0.0and1.0indicating 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
Return Value
Two new data tables.