public void testFullCorrelation2()
 {
     IDataModel dataModel = getDataModel(
     new long[] {1, 2},
     new Double?[][] {
            new double?[] {1.0, 2.0, 3.0},
            new double?[] {4.0, 5.0, 6.0},
     });
     double correlation = new SpearmanCorrelationSimilarity(dataModel).UserSimilarity(1, 2);
     assertCorrelationEquals(1.0, correlation);
 }
        public void testSimple()
        {
            IDataModel dataModel = getDataModel(
                new long[] { 1, 2 },
                new Double?[][] {
                new double?[] { 1.0, 2.0, 3.0 },
                new double?[] { 2.0, 3.0, 1.0 },
            });
            double correlation = new SpearmanCorrelationSimilarity(dataModel).UserSimilarity(1, 2);

            assertCorrelationEquals(-0.5, correlation);
        }
        public void testFullCorrelation2()
        {
            IDataModel dataModel = getDataModel(
                new long[] { 1, 2 },
                new Double?[][] {
                new double?[] { 1.0, 2.0, 3.0 },
                new double?[] { 4.0, 5.0, 6.0 },
            });
            double correlation = new SpearmanCorrelationSimilarity(dataModel).UserSimilarity(1, 2);

            assertCorrelationEquals(1.0, correlation);
        }
 public void testSimple()
 {
     IDataModel dataModel = getDataModel(
     new long[] {1, 2},
     new Double?[][] {
             new double?[]{1.0, 2.0, 3.0},
             new double?[]{2.0, 3.0, 1.0},
     });
     double correlation = new SpearmanCorrelationSimilarity(dataModel).UserSimilarity(1, 2);
     assertCorrelationEquals(-0.5, correlation);
 }