stratifiedSplit(on:by:randomSeed:)
Generates two data frames by randomly splitting the rows of a column, which you select by its name, into strata.
Declaration
func stratifiedSplit(on columnName: String, by proportion: Double, randomSeed: Int? = nil) -> (DataFrame, DataFrame)Parameters
- columnName:
The name of a column in the data frame type.
- proportion:
A proportion in the range
[0.0, 1.0]. - randomSeed:
A seed number for a random-number generator.
Return Value
A tuple of two data frames.