Function to cluster non-conformity scores using either Kolmogorov-Smirnov or K-means clustering
clusterer(
ncs,
m,
class_vec,
maxit = 100,
method = c("ks", "kmeans"),
q = seq(0.1, 0.9, by = 0.1),
min_class_size = 10
)A vector of cluster assignments, with attributes containing the clusters, coverage gaps, method used, number of clusters, and Calibrated Clustering index
Vector of non-conformity scores
Number of clusters to form
Vector of class labels
Maximum number of iterations for the clustering algorithm
Clustering method to use, either 'ks' for Kolmogorov-Smirnov or 'kmeans' for K-means clustering
Quantiles to use for K-means clustering, default is a sequence from 0.1 to 0.9 in steps of 0.1
Minimum number of observations required in a class to be included in clustering