Class: FeldtRuby::SingleLinkageMetric

Inherits:
ClusterLinkageMetric show all
Defined in:
lib/feldtruby/statistics/clustering.rb

Overview

Single linkage metric between clusters - distance between nearest members.

Instance Method Summary collapse

Methods included from SetDistance

#pairwise_distances

Methods included from CompositableDistance

#initialize

Instance Method Details

#calc(cluster1, cluster2) ⇒ Object



19
20
21
# File 'lib/feldtruby/statistics/clustering.rb', line 19

def calc(cluster1, cluster2)
  pairwise_distances(cluster1, cluster2, @sub_metric).min
end