Class: FeldtRuby::AverageLinkageMetric
- Inherits:
-
ClusterLinkageMetric
- Object
- Distance
- Metric
- CompositeMetric
- ClusterLinkageMetric
- FeldtRuby::AverageLinkageMetric
- Defined in:
- lib/feldtruby/statistics/clustering.rb
Overview
Average linkage metric between clusters.
Instance Method Summary collapse
Methods included from SetDistance
Methods included from CompositableDistance
Instance Method Details
#calc(cluster1, cluster2) ⇒ Object
12 13 14 |
# File 'lib/feldtruby/statistics/clustering.rb', line 12 def calc(cluster1, cluster2) pairwise_distances(cluster1, cluster2, @sub_metric).sum.to_f / (cluster1.length * cluster2.length) end |