lib/rumale/clustering/hdbscan.rb in rumale-clustering-0.26.0 vs lib/rumale/clustering/hdbscan.rb in rumale-clustering-0.27.0
- old
+ new
@@ -209,10 +209,10 @@
end
res
end
def cluster_stability(tree)
- tree.sort! { |a, b| a.weight <=> b.weight }
+ tree.sort_by!(&:weight)
root = tree.map(&:x).min
child_max = tree.map(&:y).max
child_max = root if child_max < root
densities = Numo::DFloat.zeros(child_max + 1) + Float::INFINITY