double correlation = new EuclideanDistanceSimilarity(dataModel, Weighting.WEIGHTED).userSimilarity(user1, user2);
assertCorrelationEquals(0.8081551272944483, correlation);
}
public void testNoCorrelation2() throws Exception {
Preference pref1 = new GenericPreference(null, new GenericItem<String>("1"), 1.0);
GenericUser<String> user1 = new GenericUser<String>("test1", Collections.singletonList(pref1));
Preference pref2 = new GenericPreference(null, new GenericItem<String>("2"), 1.0);
GenericUser<String> user2 = new GenericUser<String>("test2", Collections.singletonList(pref2));
DataModel dataModel = getDataModel(user1, user2);
double correlation = new EuclideanDistanceSimilarity(dataModel).userSimilarity(user1, user2);
assertTrue(Double.isNaN(correlation));
}