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


Java ResultUtil类代码示例

本文整理汇总了Java中de.lmu.ifi.dbs.elki.result.ResultUtil的典型用法代码示例。如果您正苦于以下问题:Java ResultUtil类的具体用法?Java ResultUtil怎么用?Java ResultUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResultUtil类属于de.lmu.ifi.dbs.elki.result包,在下文中一共展示了ResultUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result newResult) {
  List<Clustering<?>> crs = Clustering.getClusteringResults(newResult);
  if(crs.size() < 1) {
    return;
  }
  Database db = ResultUtil.findDatabase(hier);
  TypeInformation typ = new CombinedTypeInformation(this.distanceFunction.getInputTypeRestriction(), TypeUtil.NUMBER_VECTOR_FIELD);
  Relation<O> rel = db.getRelation(typ);

  if(rel != null) {
    for(Clustering<?> cl : crs) {
      evaluateClustering(db, rel, cl);
    }
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:17,代码来源:EvaluateDBCV.java

示例2: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result newResult) {
  boolean nonefound = true;
  List<Relation<?>> rels = ResultUtil.getRelations(newResult);
  for(Relation<?> rel : rels) {
    if(!TypeUtil.NUMBER_VECTOR_FIELD.isAssignableFromType(rel.getDataTypeInformation())) {
      continue;
    }
    @SuppressWarnings("unchecked")
    Relation<? extends O> vrel = (Relation<? extends O>) rel;
    ScalesResult scales = ScalesResult.getScalesResult(vrel);
    ProjectionParallel proj = new SimpleParallel(null, scales.getScales());
    PropertiesBasedStyleLibrary stylelib = new PropertiesBasedStyleLibrary();
    StylingPolicy stylepol = getStylePolicy(hier, stylelib);
    new Instance<>(vrel, proj, settings, stylepol, stylelib).run();
    nonefound = false;
  }
  if(nonefound && hier.equals(newResult)) {
    LOG.warning("3DPC did not find a number vector field relation to visualize!");
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:22,代码来源:OpenGL3DParallelCoordinates.java

示例3: newContext

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
/**
 * Make a new visualization context
 *
 * @param hier Result hierarchy
 * @param start Starting result
 * @return New context
 */
public VisualizerContext newContext(ResultHierarchy hier, Result start) {
  Collection<Relation<?>> rels = ResultUtil.filterResults(hier, Relation.class);
  for(Relation<?> rel : rels) {
    if(samplesize == 0) {
      continue;
    }
    if(!ResultUtil.filterResults(hier, rel, SamplingResult.class).isEmpty()) {
      continue;
    }
    if(rel.size() > samplesize) {
      SamplingResult sample = new SamplingResult(rel);
      sample.setSample(DBIDUtil.randomSample(sample.getSample(), samplesize, rnd));
      ResultUtil.addChildResult(rel, sample);
    }
  }
  return new VisualizerContext(hier, start, stylelib, factories);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:25,代码来源:VisualizerParameterizer.java

示例4: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(VisualizerContext context, Object start) {
  Database db = ResultUtil.findDatabase(context.getHierarchy());
  if(!(db instanceof UpdatableDatabase)) {
    return;
  }
  VisualizationTree.findVis(context, start).filter(ScatterPlotProjector.class).forEach(p -> {
    final Relation<?> rel = p.getRelation();
    if(!TypeUtil.NUMBER_VECTOR_FIELD.isAssignableFromType(rel.getDataTypeInformation())) {
      return;
    }
    context.addVis(p, new VisualizationTask(this, NAME, p.getRelation(), rel) //
        .level(VisualizationTask.LEVEL_INTERACTIVE).tool(true).visibility(false) //
        .with(RenderFlag.NO_THUMBNAIL).with(RenderFlag.NO_EXPORT) //
        .with(UpdateFlag.ON_DATA).with(UpdateFlag.ON_SAMPLE).with(UpdateFlag.ON_SELECTION));
  });
}
 
开发者ID:elki-project,项目名称:elki,代码行数:18,代码来源:MoveObjectsToolVisualization.java

示例5: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result newResult) {
  Database db = ResultUtil.findDatabase(hier);
  Collection<String> header = null;
  final ArrayList<IndexTree<?, ?>> indexes = ResultUtil.filterResults(hier, newResult, IndexTree.class);
  if (indexes == null || indexes.isEmpty()) {
    return;
  }
  for(IndexTree<?, ?> index : indexes) {
    header = new ArrayList<>();
    header.add(index.toString());
  }
  Collection<Pair<String, String>> col = new ArrayList<>();
  IndexMetaResult analysis = new IndexMetaResult(col, header);
  db.getHierarchy().add(db, analysis);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:17,代码来源:IndexStatistics.java

示例6: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result result) {
  Database db = ResultUtil.findDatabase(hier);
  // Prepare
  SetDBIDs positiveids = DBIDUtil.ensureSet(DatabaseUtil.getObjectsByLabelMatch(db, positiveClassName));

  if(positiveids.size() == 0) {
    LOG.warning("Computing a ROC curve failed - no objects matched.");
    return;
  }

  List<OutlierResult> oresults = OutlierResult.getOutlierResults(result);
  List<OrderingResult> orderings = ResultUtil.getOrderingResults(result);
  for(OutlierResult o : oresults) {
    db.getHierarchy().add(o, computeSmROCResult(positiveids, o));
    orderings.remove(o.getOrdering());
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:19,代码来源:OutlierSmROCCurve.java

示例7: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result result) {
  Database db = ResultUtil.findDatabase(hier);
  List<OutlierResult> ors = ResultUtil.filterResults(hier, OutlierResult.class);
  if (ors == null || ors.isEmpty()) {
    // logger.warning("No results found for "+JudgeOutlierScores.class.getSimpleName());
    return;
  }

  ModifiableDBIDs ids = DBIDUtil.newHashSet(ors.iterator().next().getScores().getDBIDs());
  DBIDs outlierIds = DatabaseUtil.getObjectsByLabelMatch(db, positiveClassName);
  ids.removeDBIDs(outlierIds);

  for (OutlierResult or : ors) {
    db.getHierarchy().add(or, computeScore(ids, outlierIds, or));
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:18,代码来源:JudgeOutlierScores.java

示例8: testAUC

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
/**
 * Test the AUC value for an outlier result.
 *
 * @param db Database
 * @param positive Positive class name
 * @param result Outlier result to process
 * @param expected Expected AUC value
 */
protected void testAUC(Database db, String positive, OutlierResult result, double expected) {
  OutlierROCCurve rocCurve = new ELKIBuilder<>(OutlierROCCurve.class)//
      .with(OutlierROCCurve.Parameterizer.POSITIVE_CLASS_NAME_ID, positive).build();

  // Ensure the result has been added to the hierarchy:
  ResultHierarchy hier = db.getHierarchy();
  if(hier.numParents(result) < 1) {
    hier.add(db, result);
  }

  // Compute ROC and AUC:
  rocCurve.processNewResult(hier, result);
  // Find the ROC results
  Collection<OutlierROCCurve.ROCResult> rocs = ResultUtil.filterResults(hier, result, OutlierROCCurve.ROCResult.class);
  assertTrue("No ROC result found.", !rocs.isEmpty());
  double auc = rocs.iterator().next().getAUC();
  assertFalse("More than one ROC result found.", rocs.size() > 1);
  assertEquals("ROC value does not match.", expected, auc, 0.0001);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:28,代码来源:AbstractOutlierAlgorithmTest.java

示例9: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result newResult) {
  ArrayList<PointerHierarchyRepresentationResult> hrs = ResultUtil.filterResults(hier, newResult, PointerHierarchyRepresentationResult.class);
  for(PointerHierarchyRepresentationResult pointerresult : hrs) {
    pointerresult.addChildResult(inner.run(pointerresult));
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:8,代码来源:CutDendrogramByHeightExtractor.java

示例10: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result newResult) {
  ArrayList<PointerHierarchyRepresentationResult> hrs = ResultUtil.filterResults(hier, newResult, PointerHierarchyRepresentationResult.class);
  for(PointerHierarchyRepresentationResult pointerresult : hrs) {
    Clustering<DendrogramModel> result = inner.run(pointerresult);
    pointerresult.addChildResult(result);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:9,代码来源:HDBSCANHierarchyExtractionEvaluator.java

示例11: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result result) {
  List<Clustering<?>> crs = Clustering.getClusteringResults(result);
  if(crs.isEmpty()) {
    return;
  }
  Database db = ResultUtil.findDatabase(hier);
  Relation<NumberVector> rel = db.getRelation(distance.getInputTypeRestriction());
  for(Clustering<?> c : crs) {
    evaluateClustering(db, rel, c);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:13,代码来源:EvaluateSquaredErrors.java

示例12: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result result) {
  List<Clustering<?>> crs = Clustering.getClusteringResults(result);
  if(crs.isEmpty()) {
    return;
  }
  Database db = ResultUtil.findDatabase(hier);
  Relation<O> rel = db.getRelation(distance.getInputTypeRestriction());
  DistanceQuery<O> dq = db.getDistanceQuery(rel, distance);
  for(Clustering<?> c : crs) {
    evaluateClustering(db, rel, dq, c);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:14,代码来源:EvaluateSilhouette.java

示例13: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result result) {
  List<Clustering<?>> crs = Clustering.getClusteringResults(result);
  if(crs.isEmpty()) {
    return;
  }
  Database db = ResultUtil.findDatabase(hier);
  Relation<? extends NumberVector> rel = db.getRelation(this.distanceFunction.getInputTypeRestriction());

  for(Clustering<?> c : crs) {
    evaluateClustering(db, (Relation<? extends NumberVector>) rel, c);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:14,代码来源:EvaluatePBMIndex.java

示例14: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result result) {
  List<Clustering<?>> crs = Clustering.getClusteringResults(result);
  if(crs.isEmpty()) {
    return;
  }
  Database db = ResultUtil.findDatabase(hier);
  Relation<? extends NumberVector> rel = db.getRelation(this.distance.getInputTypeRestriction());

  for(Clustering<?> c : crs) {
    evaluateClustering(db, rel, c);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:14,代码来源:EvaluateSimplifiedSilhouette.java

示例15: processNewResult

import de.lmu.ifi.dbs.elki.result.ResultUtil; //导入依赖的package包/类
@Override
public void processNewResult(ResultHierarchy hier, Result result) {
  List<Clustering<?>> crs = Clustering.getClusteringResults(result);
  if(crs.size() < 1) {
    return;
  }
  Database db = ResultUtil.findDatabase(hier);
  Relation<O> rel = db.getRelation(distance.getInputTypeRestriction());
  DistanceQuery<O> dq = db.getDistanceQuery(rel, distance);

  for(Clustering<?> c : crs) {
    evaluateClustering(db, rel, dq, c);
  }
}
 
开发者ID:elki-project,项目名称:elki,代码行数:15,代码来源:EvaluateCIndex.java


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