Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added code to print the similarity score using Euclidean Distance bet…

…ween different users
  • Loading branch information...
commit 1d23e83a4d97889abbddbf36a54ca41ad185fc27 1 parent 589c512
Robert Greiner authored
Showing with 25 additions and 1 deletion.
  1. +25 −1 Recommender/SimilarityScoreRunner.cs
26 Recommender/SimilarityScoreRunner.cs
View
@@ -1,9 +1,33 @@
-namespace Recommender
+using System;
+using Recommender.Data;
+
+namespace Recommender
{
class SimilarityScoreRunner
{
static void Main(string[] args)
{
+ RunEuclideanDistanceWithLowScore();
+ RunEuclideanDistanceWithHighScore();
+ Console.ReadKey();
+ }
+
+ private static void RunEuclideanDistanceWithLowScore()
+ {
+ var r1 = ReviewerBuilder.BuildReviewer1();
+ var r2 = ReviewerBuilder.BuildReviewer2();
+ var euclideanDistance = new EuclideanDistance(r1, r2);
+
+ Console.WriteLine("The similarity score between {0} and {1} is: {2}", r1.Name, r2.Name, euclideanDistance.Score());
+ }
+
+ private static void RunEuclideanDistanceWithHighScore()
+ {
+ var r1 = ReviewerBuilder.BuildReviewer3();
+ var r2 = ReviewerBuilder.BuildReviewer5();
+ var euclideanDistance = new EuclideanDistance(r1, r2);
+
+ Console.WriteLine("The similarity score between {0} and {1} is: {2}", r1.Name, r2.Name, euclideanDistance.Score());
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.