ComputeCorrelation() public static method

Computes the cosine similarity of two binary vectors
public static ComputeCorrelation ( HashSet vector_i, HashSet vector_j ) : float
vector_i HashSet the first vector
vector_j HashSet the second vector
return float
		[Test()] public void TestComputeCorrelation()
		{
			var vector1 = new HashSet<int>();
			vector1.Add(0);
			vector1.Add(2);
			vector1.Add(4);
			var vector2 = new HashSet<int>();
			vector2.Add(1);
			vector2.Add(3);
			vector2.Add(4);
			
			var cosine = new BinaryCosine(4);
			
			Assert.AreEqual(1 / 3f, cosine.ComputeCorrelation(vector1, vector2), DELTA);
			Assert.AreEqual(0f, cosine.ComputeCorrelation(vector1, new HashSet<int>()), DELTA);
		}