Package de.lmu.ifi.dbs.elki.result

Examples of de.lmu.ifi.dbs.elki.result.Result


    params.addParameter(SLINK.SLINK_MINCLUSTERS_ID, 3);
    SLINK<DoubleVector, DoubleDistance> slink = ClassGenericsUtil.parameterizeOrAbort(SLINK.class, params);
    testParameterizationOk(params);

    // run SLINK on database
    Result result = slink.run(db);
    Clustering<?> clustering = findSingleClustering(result);
    testFMeasure(db, clustering, 0.6829722);
    testClusterSizes(clustering, new int[] { 0, 0, 9, 200, 429 });
  }
View Full Code Here


    params.addParameter(SLINK.SLINK_MINCLUSTERS_ID, 3);
    SLINK<DoubleVector, DoubleDistance> slink = ClassGenericsUtil.parameterizeOrAbort(SLINK.class, params);
    testParameterizationOk(params);

    // run SLINK on database
    Result result = slink.run(db);
    Clustering<?> clustering = findSingleClustering(result);
    testFMeasure(db, clustering, 0.6829722);
    testClusterSizes(clustering, new int[] { 0, 0, 9, 200, 429 });
  }
View Full Code Here

  // TODO: refactor
  protected void resultToJSON(JSONBuffer re, String name) {
    ResultHierarchy hier = result.getHierarchy();
    // Find requested result
    String[] parts = name.split("/");
    Result cur = result;
    int partpos = 0;
    {
      for(; partpos < parts.length; partpos++) {
        // FIXME: handle name collisions. E.g. type_123?
        boolean found = false;
        for(Result child : hier.getChildren(cur)) {
          // logger.debug("Testing result: " + child.getShortName() + " <-> " +
          // parts[partpos]);
          if(child.getLongName().equals(parts[partpos]) || child.getShortName().equals(parts[partpos])) {
            cur = child;
            found = true;
            break;
          }
        }
        if(!found) {
          break;
        }
      }
      if(cur == null) {
        re.appendKeyValue("error", "result not found.");
        return;
      }
    }
    // logger.debug(FormatUtil.format(parts, ",") + " " + partpos + " " + cur);

    // Result structure discovery via "children" parameter.
    if(parts.length == partpos + 1) {
      if("children".equals(parts[partpos])) {
        re.appendKeyArray("children");
        Iterator<Result> iter = hier.getChildren(cur).iterator();
        while(iter.hasNext()) {
          Result child = iter.next();
          re.startHash();
          re.appendKeyValue("name", child.getShortName());
          re.appendKeyValue("type", child.getClass().getSimpleName());
          re.closeHash();
        }
        re.closeArray();
        return;
      }
View Full Code Here

      }
      logger.verbose(buf.toString());
    }
    for(Algorithm algorithm : algorithms) {
      long start = System.currentTimeMillis();
      Result res = algorithm.run(database);
      long end = System.currentTimeMillis();
      if(logger.isVerbose()) {
        long elapsedTime = end - start;
        StringBuffer buf = new StringBuffer();
        buf.append(algorithm.getClass().getName()).append(" runtime  : ");
View Full Code Here

  // TODO: refactor
  protected void resultToJSON(JSONBuffer re, String name) {
    ResultHierarchy hier = result.getHierarchy();
    // Find requested result
    String[] parts = name.split("/");
    Result cur = result;
    int partpos = 0;
    {
      for(; partpos < parts.length; partpos++) {
        // FIXME: handle name collisions. E.g. type_123?
        boolean found = false;
        for(Result child : hier.getChildren(cur)) {
          // logger.debug("Testing result: " + child.getShortName() + " <-> " +
          // parts[partpos]);
          if(child.getLongName().equals(parts[partpos]) || child.getShortName().equals(parts[partpos])) {
            cur = child;
            found = true;
            break;
          }
        }
        if(!found) {
          break;
        }
      }
      if(cur == null) {
        re.appendKeyValue("error", "result not found.");
        return;
      }
    }
    // logger.debug(FormatUtil.format(parts, ",") + " " + partpos + " " + cur);

    // Result structure discovery via "children" parameter.
    if(parts.length == partpos + 1) {
      if("children".equals(parts[partpos])) {
        re.appendKeyArray("children");
        Iterator<Result> iter = hier.getChildren(cur).iterator();
        while(iter.hasNext()) {
          Result child = iter.next();
          re.startHash();
          re.appendKeyValue("name", child.getShortName());
          re.appendKeyValue("type", child.getClass().getSimpleName());
          re.closeHash();
        }
        re.closeArray();
        return;
      }
View Full Code Here

    this.scaling = scaling;
  }

  @Override
  public OutlierResult run(Database database) throws IllegalStateException {
    Result innerresult = algorithm.run(database);

    OutlierResult or = getOutlierResult(innerresult);
    final Relation<Double> scores = or.getScores();
    if(scaling instanceof OutlierScalingFunction) {
      ((OutlierScalingFunction) scaling).prepare(or);
View Full Code Here

    if(crs == null || crs.size() < 1) {
      // logger.warning("No clustering results found - nothing to evaluate!");
      return;
    }
    // Compute the reference clustering
    Result refres = referencealg.run(db);
    List<Clustering<?>> refcrs = ResultUtil.getClusteringResults(refres);
    if(refcrs.size() == 0) {
      logger.warning("Reference algorithm did not return a clustering result!");
      return;
    }
View Full Code Here

        }
      }
    }
    if(refc == null) {
      logger.debug("Generating a new reference clustering.");
      Result refres = referencealg.run(db);
      List<Clustering<?>> refcrs = ResultUtil.getClusteringResults(refres);
      if(refcrs.size() == 0) {
        logger.warning("Reference algorithm did not return a clustering result!");
        return;
      }
View Full Code Here

      }
      logger.verbose(buf.toString());
    }
    for(Algorithm algorithm : algorithms) {
      long start = System.currentTimeMillis();
      Result res = algorithm.run(database);
      long end = System.currentTimeMillis();
      if(logger.isVerbose()) {
        long elapsedTime = end - start;
        StringBuffer buf = new StringBuffer();
        buf.append(algorithm.getClass().getName()).append(" runtime  : ");
View Full Code Here

    this.scaling = scaling;
  }

  @Override
  public OutlierResult run(Database database) throws IllegalStateException {
    Result innerresult = algorithm.run(database);

    OutlierResult or = getOutlierResult(innerresult);
    final Relation<Double> scores = or.getScores();
    if(scaling instanceof OutlierScalingFunction) {
      ((OutlierScalingFunction) scaling).prepare(or);
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.result.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.