Search in sources :

Example 46 with ListParameterization

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

the class LogNormalDistributionTest method testParameterizer.

@Test
public void testParameterizer() throws ClassInstantiationException {
    load("lognorm.ascii.gz");
    ListParameterization params = new ListParameterization();
    params.addParameter(LogNormalDistribution.Parameterizer.LOGMEAN_ID, 1.);
    params.addParameter(LogNormalDistribution.Parameterizer.LOGSTDDEV_ID, 3.);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(LogNormalDistribution.class, params);
    checkPDF(dist, "pdf_scipy_1_3", 1e-15);
}
Also used : ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization) Test(org.junit.Test)

Example 47 with ListParameterization

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

the class SkewGeneralizedNormalDistributionTest method testParameterizer.

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

Example 48 with ListParameterization

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

the class BetaDistributionTest method testParameterizer.

@Test
public void testParameterizer() throws ClassInstantiationException {
    load("beta.ascii.gz");
    ListParameterization params = new ListParameterization();
    params.addParameter(BetaDistribution.Parameterizer.ALPHA_ID, 2.);
    params.addParameter(BetaDistribution.Parameterizer.BETA_ID, 1.);
    Distribution dist = ClassGenericsUtil.parameterizeOrAbort(BetaDistribution.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 49 with ListParameterization

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

the class MultiStepGUI method addPanels.

private void addPanels(JTabbedPane panels) {
    SavedSettingsFile settings = new SavedSettingsFile(MiniGUI.SAVED_SETTINGS_FILENAME);
    try {
        settings.load();
    } catch (FileNotFoundException e) {
        LOG.warning("Error loading saved settings.", e);
    } catch (IOException e) {
        LOG.exception(e);
    }
    inputTab = new InputTabPanel();
    algTab = new AlgorithmTabPanel(inputTab);
    evalTab = new EvaluationTabPanel(inputTab, algTab);
    outTab = new OutputTabPanel(inputTab, evalTab);
    logTab = new LoggingTabPanel();
    setTab = new SavedSettingsTabPanel(settings, this);
    panels.addTab("Input", inputTab);
    panels.addTab("Algorithm", algTab);
    panels.addTab("Evaluation", evalTab);
    panels.addTab("Output", outTab);
    panels.addTab("Logging", logTab);
    panels.addTab("Saved Settings", setTab);
    setParameters(new ListParameterization());
}
Also used : AlgorithmTabPanel(de.lmu.ifi.dbs.elki.gui.multistep.panels.AlgorithmTabPanel) OutputTabPanel(de.lmu.ifi.dbs.elki.gui.multistep.panels.OutputTabPanel) FileNotFoundException(java.io.FileNotFoundException) SavedSettingsTabPanel(de.lmu.ifi.dbs.elki.gui.multistep.panels.SavedSettingsTabPanel) EvaluationTabPanel(de.lmu.ifi.dbs.elki.gui.multistep.panels.EvaluationTabPanel) IOException(java.io.IOException) InputTabPanel(de.lmu.ifi.dbs.elki.gui.multistep.panels.InputTabPanel) LoggingTabPanel(de.lmu.ifi.dbs.elki.gui.multistep.panels.LoggingTabPanel) SavedSettingsFile(de.lmu.ifi.dbs.elki.gui.util.SavedSettingsFile) ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization)

Example 50 with ListParameterization

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

the class ParameterTabPanel method updateParameterTable.

/**
 * Serialize the parameter table and run setParameters()
 */
protected void updateParameterTable() {
    parameterTable.setEnabled(false);
    ListParameterization config = new ListParameterization();
    parameterTable.appendParameters(config);
    setParameters(config);
    if (config.getErrors().size() > 0) {
        reportErrors(config);
    }
    config.clearErrors();
    parameterTable.setEnabled(true);
}
Also used : ListParameterization(de.lmu.ifi.dbs.elki.utilities.optionhandling.parameterization.ListParameterization)

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