test/clusterers/average_linkage_test.rb in ai4r-1.7 vs test/clusterers/average_linkage_test.rb in ai4r-1.8

- old
+ new

@@ -10,12 +10,10 @@ require 'test/unit' require File.dirname(__FILE__) + '/../../lib/ai4r/clusterers/average_linkage' class Ai4r::Clusterers::AverageLinkage < Ai4r::Clusterers::SingleLinkage attr_accessor :data_set, :number_of_clusters, :clusters, :distance_matrix - public :linkage_distance - public :distance_between_item_and_cluster end class AverageLinkageTest < Test::Unit::TestCase include Ai4r::Clusterers @@ -34,9 +32,14 @@ [8.0, 106.0, 85.0, 52.0, 74.0, 8.0, 53.0], [100.0, 2.0, 1.0, 16.0, 2.0, 100.0, 37.0, 100.0], [68.0, 26.0, 9.0, 0.0, 10.0, 68.0, 5.0, 52.0, 16.0], [49.0, 49.0, 26.0, 5.0, 25.0, 49.0, 4.0, 29.0, 37.0, 5.0], [2.0, 72.0, 65.0, 50.0, 52.0, 2.0, 65.0, 10.0, 74.0, 50.0, 37.0]] + + def setup + Ai4r::Clusterers::AverageLinkage.send(:public, + *Ai4r::Clusterers::AverageLinkage.protected_instance_methods) + end def test_linkage_distance clusterer = Ai4r::Clusterers::AverageLinkage.new clusterer.distance_matrix = @@expected_distance_matrix assert_equal 93.5, clusterer.linkage_distance(0,1,2)