Examples of addInstance()


Examples of org.apache.helix.manager.zk.ZKHelixAdmin.addInstance()

      Assert
          .fail("Except fail to set participant-config because participant: localhost_12918 is not added to cluster yet");
    } catch (HelixException e) {
      // OK
    }
    admin.addInstance(clusterName, new InstanceConfig("localhost_12918"));

    try {
      configAccessor.set(participantScope, "participantConfigKey", "participantConfigValue");
    } catch (Exception e) {
      Assert
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixAdmin.addInstance()

      Assert
          .fail("Except fail to set participant-config because participant: localhost_12918 is not added to cluster yet");
    } catch (HelixException e) {
      // OK
    }
    admin.addInstance(clusterName, new InstanceConfig("localhost_12918"));

    try {
      configAccessor.set(participantScope, "participantConfigKey", "participantConfigValue");
    } catch (Exception e) {
      Assert
View Full Code Here

Examples of org.apache.mahout.classifier.ConfusionMatrix.addInstance()

    line = in.readLine();
    while (line != null) {
      String[] pieces = line.split(",");        
      String trueValue = pieces[0];
      String estimatedValue = pieces[1];
      x2.addInstance(trueValue, estimatedValue);     
      line = in.readLine();
    }
    System.out.printf("%s\n\n", x2.toString());
  }
}
View Full Code Here

Examples of org.apache.mahout.classifier.ConfusionMatrix.addInstance()

   
    ConfusionMatrix matrix = new ConfusionMatrix(confusionMatrix.keySet(), defaultLabel);
    for (Map.Entry<String,Map<String,Integer>> correctLabelSet : confusionMatrix.entrySet()) {
      Map<String,Integer> rowMatrix = correctLabelSet.getValue();
      for (Map.Entry<String,Integer> classifiedLabelSet : rowMatrix.entrySet()) {
        matrix.addInstance(correctLabelSet.getKey(), classifiedLabelSet.getKey());
        matrix.putCount(correctLabelSet.getKey(), classifiedLabelSet.getKey(), classifiedLabelSet.getValue());
      }
    }
    return matrix;
   
View Full Code Here

Examples of org.apache.mahout.classifier.ResultAnalyzer.addInstance()

          }
         
          CategoryHits[] hits //<co id="co.mlt.cat"/>
            = categorizer.categorize(new StringReader(parts[1]));
          ClassifierResult result = hits.length > 0 ? hits[0] : UNKNOWN;
          resultAnalyzer.addInstance(parts[0], result); //<co id="co.mlt.an"/>
        }
       
        in.close();
      }
View Full Code Here

Examples of org.apache.mahout.classifier.ResultAnalyzer.addInstance()

            TimingStatistics.Call outercall = totalStatistics.newCall();
            ClassifierResult classifiedLabel = classifier.classifyDocument(strings.toArray(new String[strings
                .size()]), params.get("defaultCat"));
            call.end();
            outercall.end();
            boolean correct = resultAnalyzer.addInstance(correctLabel, classifiedLabel);
            if (verbose) {
              // We have one document per line
              log.info("Line Number: {} Line(30): {} Expected Label: {} Classified Label: {} Correct: {}",
                new Object[] {lineNum, line.length() > 30 ? line.substring(0, 30) : line, correctLabel,
                              classifiedLabel.getLabel(), correct,});
View Full Code Here

Examples of org.apache.mahout.classifier.ResultAnalyzer.addInstance()

      assertEquals(3, classifier.classifyDocument(document.toArray(new String[document.size()]),
        params.get("defaultCat"), 100).length);
      ClassifierResult result = classifier.classifyDocument(document.toArray(new String[document.size()]), params
          .get("defaultCat"));
      assertEquals(entry[0], result.getLabel());
      resultAnalyzer.addInstance(entry[0], result);
    }
    int[][] matrix = resultAnalyzer.getConfusionMatrix().getConfusionMatrix();
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        if (i == j)
View Full Code Here

Examples of org.apache.mahout.classifier.ResultAnalyzer.addInstance()

      assertEquals(3, classifier.classifyDocument(document.toArray(new String[document.size()]),
        params.get("defaultCat"), 100).length);
      ClassifierResult result = classifier.classifyDocument(document.toArray(new String[document.size()]), params
          .get("defaultCat"));
      assertEquals(entry[0], result.getLabel());
      resultAnalyzer.addInstance(entry[0], result);
    }
    int[][] matrix = resultAnalyzer.getConfusionMatrix().getConfusionMatrix();
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        if (i == j)
View Full Code Here

Examples of org.apache.tapestry5.ioc.Configuration.addInstance()

        replay();

        Configuration wrapper = new ValidatingConfigurationWrapper(Map.class, locator, tc, collection, "foo.Bar");

        wrapper.addInstance(HashMap.class);

        verify();

        assertListsEquals(collection, contributedValue);
    }
View Full Code Here

Examples of org.dcm4che3.tool.mkkos.MkKOS.addInstance()

        DicomFiles.scan(cl.getArgList(), new DicomFiles.Callback() {

            @Override
            public boolean dicomFile(File f, Attributes fmi,
                    long dsPos, Attributes ds) {
                return mkkos.addInstance(ds);
            }
        });
        System.out.println();
        mkkos.writeKOS();
        System.out.println(MessageFormat.format(rb.getString("stored"), mkkos.getFname()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.