stratifiedSplit(on:by:randomSeed:)
Generates two data frames by randomly splitting the rows of multiple columns, which you select by their names, into strata.
Declaration
func stratifiedSplit(on columnNames: String..., by proportion: Double, randomSeed: Int? = nil) -> (DataFrame, DataFrame)Parameters
- columnNames:
A comma-separated, or variadic, list of column names.
- 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.