sampleWithoutReplacement

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

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

df

the data frame

sampleSize

the size to generate

stream

the source of randomness

Type Parameters

T

the type of the data schema held in the data frame


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

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

dc

the data column

sampleSize

the size to generate

stream

the source of randomness

Type Parameters

T

the type of the data column


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

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

df

the data frame

sampleSize

the size to generate

streamNum

the stream number for the source of randomness

Type Parameters

T

the type of the data schema held in the data frame