Contents

stratifiedSplit(on:by:randomSeed:)

Generates two data frames by randomly splitting the rows of a column, which you select by column identifier, into strata.

Declaration

func stratifiedSplit<T>(on columnID: ColumnID<T>, by proportion: Double, randomSeed: Int? = nil) -> (DataFrame, DataFrame) where T : Hashable

Parameters

  • columnID:

    A column identifier.

  • 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.

See Also

Creating Two Data Frames by Splitting Rows