similar 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/similar/version.rb +1 -1
- data/lib/similar.rb +1 -1
- data/spec/similar_spec.rb +2 -2
- metadata +1 -1
data/lib/similar/version.rb
CHANGED
data/lib/similar.rb
CHANGED
data/spec/similar_spec.rb
CHANGED
@@ -23,11 +23,11 @@ describe Similar do
|
|
23
23
|
lambda { Similar.pearson_score(a, b) }.should raise_exception(ArgumentError, "Arrays not of equal length")
|
24
24
|
end
|
25
25
|
|
26
|
-
it "should calculate
|
26
|
+
it "should calculate euclidean distance score" do
|
27
27
|
a = 5.0, 5.0, 5.0, 5.0, 5.0
|
28
28
|
b = 4.0, 4.0, 4.0, 4.0, 4.0
|
29
29
|
|
30
|
-
score = Similar.
|
30
|
+
score = Similar.euclidean_distance(a, b)
|
31
31
|
|
32
32
|
score.should be_within(0.00001).of(0.16666666666666666)
|
33
33
|
end
|