Learn R Programming

pintervals (version 1.0.1)

clusterer: Function to cluster non-conformity scores using either Kolmogorov-Smirnov or K-means clustering

Description

Function to cluster non-conformity scores using either Kolmogorov-Smirnov or K-means clustering

Usage

clusterer(
  ncs,
  m,
  class_vec,
  maxit = 100,
  method = c("ks", "kmeans"),
  q = seq(0.1, 0.9, by = 0.1),
  min_class_size = 10
)

Value

A vector of cluster assignments, with attributes containing the clusters, coverage gaps, method used, number of clusters, and Calibrated Clustering index

Arguments

ncs

Vector of non-conformity scores

m

Number of clusters to form

class_vec

Vector of class labels

maxit

Maximum number of iterations for the clustering algorithm

method

Clustering method to use, either 'ks' for Kolmogorov-Smirnov or 'kmeans' for K-means clustering

q

Quantiles to use for K-means clustering, default is a sequence from 0.1 to 0.9 in steps of 0.1

min_class_size

Minimum number of observations required in a class to be included in clustering