Search in sources :

Example 91 with ELKIBuilder

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);
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) OutlierResult(de.lmu.ifi.dbs.elki.result.outlier.OutlierResult) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) Test(org.junit.Test)

Example 92 with ELKIBuilder

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);
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) OutlierResult(de.lmu.ifi.dbs.elki.result.outlier.OutlierResult) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) Test(org.junit.Test) AbstractOutlierAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.outlier.AbstractOutlierAlgorithmTest)

Example 93 with ELKIBuilder

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);
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) OutlierResult(de.lmu.ifi.dbs.elki.result.outlier.OutlierResult) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) WelchTTest(de.lmu.ifi.dbs.elki.math.statistics.tests.WelchTTest) Test(org.junit.Test) AbstractOutlierAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.outlier.AbstractOutlierAlgorithmTest) KolmogorovSmirnovTest(de.lmu.ifi.dbs.elki.math.statistics.tests.KolmogorovSmirnovTest)

Example 94 with ELKIBuilder

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);
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) Database(de.lmu.ifi.dbs.elki.database.Database) OutlierResult(de.lmu.ifi.dbs.elki.result.outlier.OutlierResult) DoubleVector(de.lmu.ifi.dbs.elki.data.DoubleVector) WelchTTest(de.lmu.ifi.dbs.elki.math.statistics.tests.WelchTTest) Test(org.junit.Test) AbstractOutlierAlgorithmTest(de.lmu.ifi.dbs.elki.algorithm.outlier.AbstractOutlierAlgorithmTest) KolmogorovSmirnovTest(de.lmu.ifi.dbs.elki.math.statistics.tests.KolmogorovSmirnovTest)

Example 95 with ELKIBuilder

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());
}
Also used : ELKIBuilder(de.lmu.ifi.dbs.elki.utilities.ELKIBuilder) MultipleObjectsBundle(de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle) AbstractDataSourceTest(de.lmu.ifi.dbs.elki.datasource.AbstractDataSourceTest) Test(org.junit.Test)

Aggregations

ELKIBuilder (de.lmu.ifi.dbs.elki.utilities.ELKIBuilder)114 Test (org.junit.Test)111 Database (de.lmu.ifi.dbs.elki.database.Database)102 DoubleVector (de.lmu.ifi.dbs.elki.data.DoubleVector)75 AbstractClusterAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)73 OutlierResult (de.lmu.ifi.dbs.elki.result.outlier.OutlierResult)26 AbstractOutlierAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.outlier.AbstractOutlierAlgorithmTest)22 Model (de.lmu.ifi.dbs.elki.data.model.Model)11 AbstractDataSourceTest (de.lmu.ifi.dbs.elki.datasource.AbstractDataSourceTest)10 MultipleObjectsBundle (de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle)10 MedoidModel (de.lmu.ifi.dbs.elki.data.model.MedoidModel)7 SubspaceModel (de.lmu.ifi.dbs.elki.data.model.SubspaceModel)5 InputStreamDatabaseConnection (de.lmu.ifi.dbs.elki.datasource.InputStreamDatabaseConnection)3 WeightedCovarianceMatrixBuilder (de.lmu.ifi.dbs.elki.math.linearalgebra.pca.WeightedCovarianceMatrixBuilder)3 InputStream (java.io.InputStream)3 CorrelationModel (de.lmu.ifi.dbs.elki.data.model.CorrelationModel)2 PercentageEigenPairFilter (de.lmu.ifi.dbs.elki.math.linearalgebra.pca.filter.PercentageEigenPairFilter)2 KolmogorovSmirnovTest (de.lmu.ifi.dbs.elki.math.statistics.tests.KolmogorovSmirnovTest)2 WelchTTest (de.lmu.ifi.dbs.elki.math.statistics.tests.WelchTTest)2 ArrayList (java.util.ArrayList)2