Contents

stratifiedSplit(on:_:by:randomSeed:)

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

Declaration

func stratifiedSplit<T0, T1>(on columnID0: ColumnID<T0>, _ columnID1: ColumnID<T1>, by proportion: Double, randomSeed: Int? = nil) -> (DataFrame, DataFrame) where T0 : Hashable, T1 : Hashable

Parameters

  • columnID0:

    A column identifier.

  • columnID1:

    Another 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