@@ -0,0 +1,2098 @@
+/*%0A * This file is part of ELKI:%0A * Environment for Developing KDD-Applications Supported by Index-Structures%0A * %0A * Copyright (C) 2020%0A * ELKI Development Team%0A * %0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A * %0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A * GNU Affero General Public License for more details.%0A * %0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0Apackage elki.evaluation.clustering;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.junit.Test;%0A%0Aimport elki.database.ids.DBIDRange;%0Aimport elki.database.ids.DBIDUtil;%0A%0A/**%0A * Validate the %7B@link PairSetsIndex%7D measures.%0A * %0A * @author Robert Gehde%0A */%0Apublic class PairSetsIndexTest extends AbstractClusterEvaluationTest %7B%0A  @Test%0A  public void testPairSetsIndexEquals() %7B%0A    DBIDRange ids = DBIDUtil.generateStaticDBIDRange(SAMEA.length);%0A    PairSetsIndex psi = new PairSetsIndex(new ClusterContingencyTable(false, false, makeClustering(ids.iter(), SAMEA), makeClustering(ids.iter(), SAMEB)));%0A%0A    assertEquals(%22PSI on an equal example should be 1.%22, 1, psi.psi, 1e-13);%0A    assertEquals(%22Simplified PSI on an equal example should be 1.%22, psi.simplifiedPSI, 1, 1e-13);%0A  %7D%0A%0A  @Test%0A  public void tesPairSetsIndexSKLearn() %7B%0A    DBIDRange ids = DBIDUtil.generateStaticDBIDRange(SKLEARNA.length);%0A    PairSetsIndex psi = new PairSetsIndex(new ClusterContingencyTable(false, false, makeClustering(ids.iter(), SKLEARNA), makeClustering(ids.iter(), SKLEARNB)));%0A%0A    assertEquals(%22PSI value not as expected%22, .516598639455782, psi.psi, 1e-13);%0A    assertEquals(%22Simplified PSI value not as expected%22, .502380952380952, psi.simplifiedPSI, 1e-13);%0A  %7D%0A%7D%0A

Add unit test for Pair Sets Index