generate

abstract fun generate(sortedData: DoubleArray, numGroups: Int, certificate: AdmissibilityCertificate): DataPartition?(source)

Generates a partition of the supplied sorted data into the requested number of groups, or returns null when no partition satisfying the certificate can be produced.

Parameters

sortedData

the observations in non-decreasing order

numGroups

the requested number of groups, must be positive

certificate

the structural constraints the partition must satisfy; its number of observations must match the size of the supplied data