当前位置: 首页>>代码示例>>Java>>正文


Java AbstractAlgorithm类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:24,代码来源:ClassifierHoldoutEvaluationTask.java

示例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();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:20,代码来源:HDBSCANHierarchyExtraction.java

示例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();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:21,代码来源:ClustersWithNoiseExtraction.java

示例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();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:19,代码来源:ComputeSimilarityMatrixImage.java

示例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);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:17,代码来源:SimpleOutlierEnsemble.java

示例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();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:14,代码来源:KNNClassifier.java

示例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);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:10,代码来源:CutDendrogramByHeightExtractor.java

示例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);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:10,代码来源:CutDendrogramByNumberOfClustersExtractor.java

示例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);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:9,代码来源:SimplifiedHierarchyExtractionEvaluator.java

示例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);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:9,代码来源:HDBSCANHierarchyExtractionEvaluator.java

示例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();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:13,代码来源:AbstractCutDendrogram.java

示例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();
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:SimplifiedHierarchyExtraction.java

示例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 });
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:MiniMaxNNChainTest.java

示例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 });
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:MiniMaxNNChainTest.java

示例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 });
}
 
开发者ID:elki-project,项目名称:elki,代码行数:16,代码来源:AnderbergHierarchicalClusteringTest.java


注:本文中的de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。