Search in sources :

Example 41 with ListParameterization

use of de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization in project elki by elki-project.

the class ExponentiallyModifiedGaussianDistributionTest method testParameterizer.

// TODO: once quantile() is implemented, add a test.
@Test
public void testParameterizer() throws ClassInstantiationException {
    load("emg.ascii.gz");
    ListParameterization params = new ListParameterization();
    params.addParameter(ExponentiallyModifiedGaussianDistribution.Parameterizer.LOCATION_ID, 1.);
    params.addParameter(ExponentiallyModifiedGaussianDistribution.Parameterizer.SCALE_ID, 3);
    params.addParameter(ExponentiallyModifiedGaussianDistribution.Parameterizer.RATE_ID, .5);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(ExponentiallyModifiedGaussianDistribution.class, params);
    checkPDF(dist, "pdf_gnur_1_3_05", 1e-15);
}
Also used : ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization) Test(org.junit.Test)

Example 42 with ListParameterization

use of de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization in project elki by elki-project.

the class ConstantDistributionTest method testParameterizer.

@Test
public void testParameterizer() throws ClassInstantiationException {
    ListParameterization params = new ListParameterization();
    params.addParameter(ConstantDistribution.Parameterizer.CONSTANT_ID, 2.);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(ConstantDistribution.class, params);
    assertEquals(dist.nextRandom(), 2, 0.);
}
Also used : ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization) Test(org.junit.Test)

Example 43 with ListParameterization

use of de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization in project elki by elki-project.

the class GammaDistributionTest method testParameterizer.

@Test
public void testParameterizer() throws ClassInstantiationException {
    load("gamma.ascii.gz");
    ListParameterization params = new ListParameterization();
    params.addParameter(GammaDistribution.Parameterizer.K_ID, 2.);
    params.addParameter(GammaDistribution.Parameterizer.THETA_ID, 1.);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(GammaDistribution.class, params);
    checkPDF(dist, "pdf_scipy_2_1", 1e-15);
}
Also used : ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization) Test(org.junit.Test)

Example 44 with ListParameterization

use of de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization in project elki by elki-project.

the class GumbelDistributionTest method testParameterizer.

@Test
public void testParameterizer() throws ClassInstantiationException {
    load("gumbel.ascii.gz");
    ListParameterization params = new ListParameterization();
    params.addParameter(GumbelDistribution.Parameterizer.LOCATION_ID, 2.);
    params.addParameter(GumbelDistribution.Parameterizer.SHAPE_ID, 1.);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(GumbelDistribution.class, params);
    checkPDF(dist, "pdf_scipy_2_1", 1e-15);
}
Also used : ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization) Test(org.junit.Test)

Example 45 with ListParameterization

use of de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization in project elki by elki-project.

the class InverseGaussianDistributionTest method testParameterizer.

@Test
public void testParameterizer() throws ClassInstantiationException {
    load("invgauss.ascii.gz");
    ListParameterization params = new ListParameterization();
    params.addParameter(InverseGaussianDistribution.Parameterizer.LOCATION_ID, .5);
    params.addParameter(InverseGaussianDistribution.Parameterizer.SHAPE_ID, 1.);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(InverseGaussianDistribution.class, params);
    checkPDF(dist, "pdf_scipy_05_1", 1e-15);
}
Also used : ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization) Test(org.junit.Test)

Aggregations

ListParameterization (de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization)76 Test (org.junit.Test)68 AbstractIndexStructureTest (de.lmu.ifi.dbs.elki.index.AbstractIndexStructureTest)26 Database (de.lmu.ifi.dbs.elki.database.Database)10 AbstractSimpleAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.AbstractSimpleAlgorithmTest)9 DoubleVector (de.lmu.ifi.dbs.elki.data.DoubleVector)9 LinearScanDistanceKNNQuery (de.lmu.ifi.dbs.elki.database.query.knn.LinearScanDistanceKNNQuery)8 HilbertSpatialSorter (de.lmu.ifi.dbs.elki.math.spacefillingcurves.HilbertSpatialSorter)6 SpacefillingKNNPreprocessor (de.lmu.ifi.dbs.elki.index.preprocessed.knn.SpacefillingKNNPreprocessor)5 Random (java.util.Random)3 AbstractClusterAlgorithmTest (de.lmu.ifi.dbs.elki.algorithm.clustering.AbstractClusterAlgorithmTest)2 Model (de.lmu.ifi.dbs.elki.data.model.Model)2 StaticArrayDatabase (de.lmu.ifi.dbs.elki.database.StaticArrayDatabase)2 InputStreamDatabaseConnection (de.lmu.ifi.dbs.elki.datasource.InputStreamDatabaseConnection)2 MaterializeKNNAndRKNNPreprocessor (de.lmu.ifi.dbs.elki.index.preprocessed.knn.MaterializeKNNAndRKNNPreprocessor)2 NormalDistribution (de.lmu.ifi.dbs.elki.math.statistics.distribution.NormalDistribution)2 NormalMOMEstimator (de.lmu.ifi.dbs.elki.math.statistics.distribution.estimator.NormalMOMEstimator)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 ByLabelClustering (de.lmu.ifi.dbs.elki.algorithm.clustering.trivial.ByLabelClustering)1