use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class GaussianModelTest method testGaussianModel.
@Test
public void testGaussianModel() {
Database db = makeSimpleDatabase(UNITTEST + "outlier-fire.ascii", 1025);
OutlierResult result = new ELKIBuilder<GaussianModel<DoubleVector>>(GaussianModel.class).build().run(db);
testSingleScore(result, 1025, 2.8312466458765426);
testAUC(db, "Noise", result, 0.9937641025641025);
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class LBABODTest method testLBABOD.
@Test
public void testLBABOD() {
Database db = makeSimpleDatabase(UNITTEST + "outlier-3d-3clusters.ascii", 960);
OutlierResult result = //
new ELKIBuilder<LBABOD<DoubleVector>>(LBABOD.class).with(FastABOD.Parameterizer.K_ID, //
150).with(LBABOD.Parameterizer.L_ID, //
10).build().run(db);
testAUC(db, "Noise", result, 0.92279629629629);
testSingleScore(result, 945, 2.0897348547799E-5);
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class HiCSTest method testHiCSWelch.
@Test
public void testHiCSWelch() {
Database db = makeSimpleDatabase(UNITTEST + "outlier-axis-subspaces-6d.ascii", 1345);
OutlierResult result = //
new ELKIBuilder<HiCS<DoubleVector>>(HiCS.class).with(LOF.Parameterizer.K_ID, //
10).with(HiCS.Parameterizer.LIMIT_ID, //
10).with(HiCS.Parameterizer.SEED_ID, //
0).with(HiCS.Parameterizer.TEST_ID, //
WelchTTest.STATIC).build().run(db);
testAUC(db, "Noise", result, 0.867159);
testSingleScore(result, 1293, 4.7877822);
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class HiCSTest method testHiCSKS.
@Test
public void testHiCSKS() {
Database db = makeSimpleDatabase(UNITTEST + "outlier-axis-subspaces-6d.ascii", 1345);
OutlierResult result = //
new ELKIBuilder<HiCS<DoubleVector>>(HiCS.class).with(LOF.Parameterizer.K_ID, //
10).with(HiCS.Parameterizer.LIMIT_ID, //
10).with(HiCS.Parameterizer.SEED_ID, //
0).with(HiCS.Parameterizer.TEST_ID, //
KolmogorovSmirnovTest.STATIC).build().run(db);
testAUC(db, "Noise", result, 0.85340056);
testSingleScore(result, 1293, 4.935802);
}
use of de.lmu.ifi.dbs.elki.utilities.ELKIBuilder in project elki by elki-project.
the class ClassLabelFilterTest method parameters.
/**
* Test with parameter c as the column which is to be converted to a class
* label.
*/
@Test
public void parameters() {
final int c = 2;
String filename = UNITTEST + "external-id-test-1.csv";
ClassLabelFilter filter = //
new ELKIBuilder<>(ClassLabelFilter.class).with(ClassLabelFilter.Parameterizer.CLASS_LABEL_INDEX_ID, c).build();
MultipleObjectsBundle bundle = readBundle(filename, filter);
// Ensure that the filter has correctly formed the bundle.
// We expect that the bundle's first column is a number vector field.
// We expect that the bundle's second column is a SimpleClassLabel
// We expect that the bundle's third column is a LabelList
// Ensure the first column are the vectors.
assertTrue("Test file not as expected", TypeUtil.NUMBER_VECTOR_FIELD.isAssignableFromType(bundle.meta(0)));
// Ensure that the second column are the ExternalID objects.
Object obj = bundle.data(0, 1);
assertEquals("Unexpected data type", SimpleClassLabel.class, obj.getClass());
// Ensure that the length of the list of ExternalID objects has the correct
// length.
assertEquals("Unexpected data length", bundle.dataLength(), bundle.getColumn(1).size());
// Ensure that the third column are the LabelList objects.
obj = bundle.data(0, 2);
assertEquals("Unexpected data type", LabelList.class, obj.getClass());
}
Aggregations