本文整理汇总了Java中de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm类的典型用法代码示例。如果您正苦于以下问题:Java AbstractAlgorithm类的具体用法?Java AbstractAlgorithm怎么用?Java AbstractAlgorithm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractAlgorithm类属于de.lmu.ifi.dbs.elki.algorithm包,在下文中一共展示了AbstractAlgorithm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
// Get database connection.
final ObjectParameter<DatabaseConnection> dbcP = new ObjectParameter<>(AbstractDatabase.Parameterizer.DATABASE_CONNECTION_ID, DatabaseConnection.class, FileBasedDatabaseConnection.class);
if(config.grab(dbcP)) {
databaseConnection = dbcP.instantiateClass(config);
}
// Get indexes.
final ObjectListParameter<IndexFactory<?, ?>> indexFactoryP = new ObjectListParameter<>(AbstractDatabase.Parameterizer.INDEX_ID, IndexFactory.class, true);
if(config.grab(indexFactoryP)) {
indexFactories = indexFactoryP.instantiateClasses(config);
}
ObjectParameter<Classifier<O>> algorithmP = new ObjectParameter<>(AbstractAlgorithm.ALGORITHM_ID, Classifier.class);
if(config.grab(algorithmP)) {
algorithm = algorithmP.instantiateClass(config);
}
ObjectParameter<Holdout> holdoutP = new ObjectParameter<>(HOLDOUT_ID, Holdout.class, StratifiedCrossValidation.class);
if(config.grab(holdoutP)) {
holdout = holdoutP.instantiateClass(config);
}
}
示例2: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ObjectParameter<HierarchicalClusteringAlgorithm> algorithmP = new ObjectParameter<>(AbstractAlgorithm.ALGORITHM_ID, HierarchicalClusteringAlgorithm.class);
if(config.grab(algorithmP)) {
algorithm = algorithmP.instantiateClass(config);
}
IntParameter minclustersP = new IntParameter(MINCLUSTERSIZE_ID, 1) //
.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
if(config.grab(minclustersP)) {
minClSize = minclustersP.intValue();
}
Flag hierarchicalF = new Flag(HIERARCHICAL_ID);
if(config.grab(hierarchicalF)) {
hierarchical = hierarchicalF.isTrue();
}
}
示例3: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ObjectParameter<HierarchicalClusteringAlgorithm> algorithmP = new ObjectParameter<>(AbstractAlgorithm.ALGORITHM_ID, HierarchicalClusteringAlgorithm.class);
if(config.grab(algorithmP)) {
algorithm = algorithmP.instantiateClass(config);
}
IntParameter numClP = new IntParameter(K_ID) //
.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
if(config.grab(numClP)) {
numCl = numClP.intValue();
}
IntParameter minclustersP = new IntParameter(MINCLUSTERSIZE_ID) //
.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
if(config.grab(minclustersP)) {
minClSize = minclustersP.intValue();
}
}
示例4: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ObjectParameter<DistanceFunction<O>> distanceFunctionP = AbstractAlgorithm.makeParameterDistanceFunction(EuclideanDistanceFunction.class, DistanceFunction.class);
if(config.grab(distanceFunctionP)) {
distanceFunction = distanceFunctionP.instantiateClass(config);
}
ObjectParameter<ScalingFunction> scalingP = new ObjectParameter<>(SCALING_ID, ScalingFunction.class, true);
if(config.grab(scalingP)) {
scaling = scalingP.instantiateClass(config);
}
Flag skipzeroP = new Flag(SKIPZERO_ID);
if(config.grab(skipzeroP)) {
skipzero = skipzeroP.getValue();
}
}
示例5: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ObjectListParameter<OutlierAlgorithm> algP = new ObjectListParameter<>(AbstractAlgorithm.ALGORITHM_ID, OutlierAlgorithm.class);
if (config.grab(algP)) {
ListParameterization subconfig = new ListParameterization();
ChainedParameterization chain = new ChainedParameterization(subconfig, config);
chain.errorsTo(config);
algorithms = algP.instantiateClasses(chain);
subconfig.logAndClearReportedErrors();
}
ObjectParameter<EnsembleVoting> votingP = new ObjectParameter<>(VOTING_ID, EnsembleVoting.class);
if (config.grab(votingP)) {
voting = votingP.instantiateClass(config);
}
}
示例6: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ObjectParameter<DistanceFunction<? super O>> distP = AbstractAlgorithm.makeParameterDistanceFunction(EuclideanDistanceFunction.class, DistanceFunction.class);
if(config.grab(distP)) {
distanceFunction = distP.instantiateClass(config);
}
IntParameter kP = new IntParameter(K_ID, 1)//
.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
if(config.grab(kP)) {
k = kP.intValue();
}
}
示例7: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ListParameterization overrides = new ListParameterization();
overrides.addParameter(AbstractAlgorithm.ALGORITHM_ID, DummyHierarchicalClusteringAlgorithm.class);
ChainedParameterization list = new ChainedParameterization(overrides, config);
list.errorsTo(config);
inner = list.tryInstantiate(CutDendrogramByHeight.class);
}
示例8: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ListParameterization overrides = new ListParameterization();
overrides.addParameter(AbstractAlgorithm.ALGORITHM_ID, DummyHierarchicalClusteringAlgorithm.class);
ChainedParameterization list = new ChainedParameterization(overrides, config);
list.errorsTo(config);
inner = list.tryInstantiate(CutDendrogramByNumberOfClusters.class);
}
示例9: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ListParameterization overrides = new ListParameterization();
overrides.addParameter(AbstractAlgorithm.ALGORITHM_ID, DummyHierarchicalClusteringAlgorithm.class);
ChainedParameterization list = new ChainedParameterization(overrides, config);
inner = ClassGenericsUtil.parameterizeOrAbort(SimplifiedHierarchyExtraction.class, list);
}
示例10: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ListParameterization overrides = new ListParameterization();
overrides.addParameter(AbstractAlgorithm.ALGORITHM_ID, DummyHierarchicalClusteringAlgorithm.class);
ChainedParameterization list = new ChainedParameterization(overrides, config);
inner = ClassGenericsUtil.parameterizeOrAbort(HDBSCANHierarchyExtraction.class, list);
}
示例11: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ObjectParameter<HierarchicalClusteringAlgorithm> algorithmP = new ObjectParameter<>(AbstractAlgorithm.ALGORITHM_ID, HierarchicalClusteringAlgorithm.class);
if(config.grab(algorithmP)) {
algorithm = algorithmP.instantiateClass(config);
}
Flag hierarchicalF = new Flag(HIERARCHICAL_ID);
if(config.grab(hierarchicalF)) {
hierarchical = hierarchicalF.isTrue();
}
}
示例12: makeOptions
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
@Override
protected void makeOptions(Parameterization config) {
super.makeOptions(config);
ObjectParameter<HierarchicalClusteringAlgorithm> algorithmP = new ObjectParameter<>(AbstractAlgorithm.ALGORITHM_ID, HierarchicalClusteringAlgorithm.class);
if(config.grab(algorithmP)) {
algorithm = algorithmP.instantiateClass(config);
}
IntParameter minclustersP = new IntParameter(MINCLUSTERSIZE_ID, 1) //
.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
if(config.grab(minclustersP)) {
minClSize = minclustersP.intValue();
}
}
示例13: testMiniMax
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testMiniMax() {
Database db = makeSimpleDatabase(UNITTEST + "single-link-effect.ascii", 638);
Clustering<?> clustering = new ELKIBuilder<>(CutDendrogramByNumberOfClusters.class) //
.with(CutDendrogramByNumberOfClusters.Parameterizer.MINCLUSTERS_ID, 3) //
.with(AbstractAlgorithm.ALGORITHM_ID, MiniMaxNNChain.class) //
.build().run(db);
testFMeasure(db, clustering, 0.938662648);
testClusterSizes(clustering, new int[] { 200, 211, 227 });
}
示例14: testMiniMax2
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testMiniMax2() {
Database db = makeSimpleDatabase(UNITTEST + "3clusters-and-noise-2d.csv", 330);
Clustering<?> clustering = new ELKIBuilder<>(CutDendrogramByNumberOfClusters.class) //
.with(CutDendrogramByNumberOfClusters.Parameterizer.MINCLUSTERS_ID, 3) //
.with(AbstractAlgorithm.ALGORITHM_ID, MiniMaxNNChain.class) //
.build().run(db);
testFMeasure(db, clustering, 0.914592130);
testClusterSizes(clustering, new int[] { 59, 112, 159 });
}
示例15: testSingleLink
import de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm; //导入依赖的package包/类
/**
* Run agglomerative hierarchical clustering with fixed parameters and compare
* the result to a golden standard.
*/
@Test
public void testSingleLink() {
Database db = makeSimpleDatabase(UNITTEST + "single-link-effect.ascii", 638);
Clustering<?> clustering = new ELKIBuilder<>(CutDendrogramByNumberOfClusters.class) //
.with(CutDendrogramByNumberOfClusters.Parameterizer.MINCLUSTERS_ID, 3) //
.with(AbstractAlgorithm.ALGORITHM_ID, AnderbergHierarchicalClustering.class) //
.with(AGNES.Parameterizer.LINKAGE_ID, SingleLinkage.class) //
.build().run(db);
testFMeasure(db, clustering, 0.6829722);
testClusterSizes(clustering, new int[] { 9, 200, 429 });
}