Skip to content

Commit

Permalink
added more scenarios to the similarity score runner.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgreiner committed Nov 7, 2011
1 parent 34aefb2 commit bc64d2d
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions Recommender/SimilarityScoreRunner.cs
Expand Up @@ -8,7 +8,10 @@ class SimilarityScoreRunner
static void Main(string[] args)
{
RunEuclideanDistanceWithLowScore();
RunPearsonCorrelationWithLowScore();
Console.WriteLine();
RunEuclideanDistanceWithHighScore();
RunPearsonCorrelationWithHighScore();
Console.ReadKey();
}

Expand All @@ -18,16 +21,34 @@ private static void RunEuclideanDistanceWithLowScore()
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());
Console.WriteLine("The Euclidean Distance 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 r1 = ReviewerBuilder.BuildReviewer4();
var r2 = ReviewerBuilder.BuildReviewer1();
var euclideanDistance = new EuclideanDistance(r1, r2);

Console.WriteLine("The similarity score between {0} and {1} is: {2}", r1.Name, r2.Name, euclideanDistance.Score());
Console.WriteLine("The Euclidean Distance between {0} and {1} is: {2}", r1.Name, r2.Name, euclideanDistance.Score());
}

private static void RunPearsonCorrelationWithLowScore()
{
var r1 = ReviewerBuilder.BuildReviewer1();
var r2 = ReviewerBuilder.BuildReviewer2();
var pearsonCorrelation = new PearsonCorrelation(r1, r2);

Console.WriteLine("The Pearson Correlation between {0} and {1} is: {2}", r1.Name, r2.Name, pearsonCorrelation.Score());
}

private static void RunPearsonCorrelationWithHighScore()
{
var r1 = ReviewerBuilder.BuildReviewer4();
var r2 = ReviewerBuilder.BuildReviewer1();
var pearsonCorrelation = new PearsonCorrelation(r1, r2);

Console.WriteLine("The Pearson Correlation between {0} and {1} is: {2}", r1.Name, r2.Name, pearsonCorrelation.Score());
}
}
}

0 comments on commit bc64d2d

Please sign in to comment.