sampleWithoutReplacement

fun <T> sampleWithoutReplacement(df: DataFrame<T>, sampleSize: Int, stream: RNStreamIfc = KSLRandom.defaultRNStream()): DataFrame<T>

The data frame df, is not changed. The returned data frame holds a sample of the rows from df

Return

a new data frame with the sample from df with sampleSize rows

Parameters

T

the type of the data schema held in the data frame

df

the data frame

sampleSize

the size to generate

stream

the source of randomness


inline fun <T> sampleWithoutReplacement(dc: DataColumn<T>, sampleSize: Int, stream: RNStreamIfc = KSLRandom.defaultRNStream()): DataColumn<T>

A new DataColumn is created, such that the first sampleSize elements contain the sampled values. That is, x.get(0), x.get(1), ... , x.get(sampleSize-1) is the random sample without replacement

Return

the new data column of size sampleSize

Parameters

T

the type of the data column

dc

the data column

sampleSize

the size to generate

stream

the source of randomness


fun <T> sampleWithoutReplacement(df: DataFrame<T>, sampleSize: Int, streamNum: Int): DataFrame<T>

The data frame df, is not changed. The returned data frame holds a sample of the rows from df

Return

a new data frame with the sample from df with sampleSize rows

Parameters

T

the type of the data schema held in the data frame

df

the data frame

sampleSize

the size to generate

streamNum

the stream number for the source of randomness