Search in sources :

Example 36 with ListParameterization

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

the class ExpGammaDistributionTest method testParameterizer.

@Test
public void testParameterizer() throws ClassInstantiationException {
    load("expgamma.ascii.gz");
    ListParameterization params = new ListParameterization();
    params.addParameter(ExpGammaDistribution.Parameterizer.K_ID, 2.);
    params.addParameter(ExpGammaDistribution.Parameterizer.THETA_ID, 1.);
    params.addParameter(ExpGammaDistribution.Parameterizer.SHIFT_ID, 0.);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(ExpGammaDistribution.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 37 with ListParameterization

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

the class MultiStepGUI method serializeParameters.

/**
 * Get the serialized parameters
 *
 * @return Serialized parameters
 */
public ArrayList<String> serializeParameters() {
    ListParameterization params = new ListParameterization();
    logTab.appendParameters(params);
    inputTab.appendParameters(params);
    algTab.appendParameters(params);
    evalTab.appendParameters(params);
    outTab.appendParameters(params);
    return params.serialize();
}
Also used : ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization)

Example 38 with ListParameterization

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

the class ParameterTabPanel method execute.

/**
 * Execute the task.
 */
protected synchronized void execute() {
    ListParameterization config = new ListParameterization();
    parameterTable.appendParameters(config);
    runButton.setEnabled(false);
    try {
        configureStep(config);
        if (config.hasUnusedParameters()) {
            // List<Pair<OptionID, Object>> remainingParameters =
            // config.getRemainingParameters();
            LOG.warning("Unused parameters: " + "FIXME");
        }
        if (config.getErrors().size() > 0) {
            reportErrors(config);
        } else {
            executeStep();
        }
    } catch (Exception e) {
        LOG.exception(e);
    }
    updateStatus();
    firePanelUpdated();
}
Also used : UnspecifiedParameterException(de.lmu.ifi.dbs.elki.utilities.optionhandling.UnspecifiedParameterException) ParameterException(de.lmu.ifi.dbs.elki.utilities.optionhandling.ParameterException) ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization)

Example 39 with ListParameterization

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

the class CauchyDistributionTest method testParameterizer.

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

Example 40 with ListParameterization

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

the class ChiSquaredDistributionTest method testParameterizer.

@Test
public void testParameterizer() throws ClassInstantiationException {
    load("chisq.ascii.gz");
    ListParameterization params = new ListParameterization();
    params.addParameter(ChiSquaredDistribution.Parameterizer.DOF_ID, 2.);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(ChiSquaredDistribution.class, params);
    checkPDF(dist, "pdf_scipy_2", 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