Module: FeldtRuby::SetDistance
- Included in:
- ClusterLinkageMetric
- Defined in:
- lib/feldtruby/statistics/distance.rb
Overview
Functions specific to distances defined on sets of individual objects
Instance Method Summary collapse
Instance Method Details
#pairwise_distances(set1, set2, metric) ⇒ Object
19 20 21 |
# File 'lib/feldtruby/statistics/distance.rb', line 19 def pairwise_distances(set1, set2, metric) set1.map {|a| set2.map {|b| metric.calc(a,b)}}.flatten end |