Partition Generator Ifc
Produces an initial contiguous partition of sorted data into a requested number of groups.
Implementations supply a starting point for the refinement stage; they are not required to optimize the fitting objective, only to produce a structurally valid partition by whatever criterion they represent. Different generators exist so that the sensitivity of the fitted result to its initialization can be measured rather than assumed.
Implementations must return a partition all of whose groups satisfy the supplied certificate, or null when they cannot. Returning a structurally invalid partition is a defect: the caller is entitled to assume the result is usable.
Scale matters when choosing one. A positive quantity spanning orders of magnitude is the ordinary case in input modeling, and the generators treat it differently:
JenksPartitionGeneratorminimises within-group squared error on the raw scale, which on a right-skewed sample is cheapest to reduce in the tail, so it spends its cuts there. It is the default.QuantilePartitionGeneratorcuts at equally spaced ranks, so it is scale-free, and it is unbiased rather than shape-aware.HistogramValleyPartitionGeneratorbins at equally spaced ranks and compares densities by ratio, so it is scale-free in both, and it looks for gaps in density.
Because they fail in different places, MixtureModeler.fitMultiStart runs several and keeps the best by criterion at each count.
Inheritors
Properties
Functions
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.
Verifies that every group of the supplied partition satisfies the certificate. Provided so that implementations can check their own output before returning it, and so that tests can state the contract once.