test/clusterers/complete_linkage_test.rb in ai4r-1.7 vs test/clusterers/complete_linkage_test.rb in ai4r-1.8
- old
+ new
@@ -10,12 +10,10 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../../lib/ai4r/clusterers/complete_linkage'
class Ai4r::Clusterers::CompleteLinkage
attr_accessor :data_set, :number_of_clusters, :clusters, :distance_matrix
- public :linkage_distance
- public :distance_between_item_and_cluster
end
class CompleteLinkageTest < 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::CompleteLinkage.send(:public,
+ *Ai4r::Clusterers::CompleteLinkage.protected_instance_methods)
+ end
def test_linkage_distance
clusterer = Ai4r::Clusterers::CompleteLinkage.new
clusterer.distance_matrix = @@expected_distance_matrix
assert_equal 98, clusterer.linkage_distance(0,1,2)