Cluster entries using K-Medoids (PAM / Lloyd-like).
Input:
- A pairwise distance TSV file (
name1\tname2\tdistance). Lower distances indicate higher similarity.
Output:
--format cluster(default): each line contains points of one cluster.--format pair: each line contains a(representative, member)pair.
Notes:
- The input must contain distances, not similarities.
--k <N>: number of clusters (required). Must not exceed the number of samples.--runs <N>: number of random initializations (default:10).--max-iter <N>: maximum number of iterations (default:100).--seed <N>: random seed for reproducible initialization.--same <V>: default score of identical element pairs (default:0.0).--missing <V>: default score of missing pairs (default:1.0).- Alias:
necom clust kmis equivalent tonecom clust k-medoids. - The representative point is selected by
--rep:medoid(default): point with minimum sum of distances to other cluster members.first: alphabetically first member.
- In
clusterformat, the representative is placed first; inpairformat, it is the first column. - If a cluster becomes empty during iteration, it is omitted from the output, so the final number of clusters may be less than
k.
Examples:
-
Run K-Medoids with K=3
necom clust k-medoids pairs.tsv --k 3 -
Output as pairs
necom clust k-medoids pairs.tsv --k 3 --format pair -
Reproducible run with seed
necom clust k-medoids pairs.tsv --k 3 --seed 42