Package org.jamesii.asf.spdm.dataimport

Examples of org.jamesii.asf.spdm.dataimport.PerformanceTuple


  /**
   * Constructs data compatible with Joone's neural networks.
   */
  final void constructNNData() {
    for (int i = 0; i < input.size(); i++) {
      PerformanceTuple perfTuple = input.get(i);
      Map<String, Object> tupleAttribs = perfTuple.getAllAttributes();
      for (int j = 0; j < attributes.size(); j++) {
        inputData[i][j] =
            JooneUtils.calculateAttribute(attributes.get(j), tupleAttribs,
                j < nomAttribEncodings.size() ? nomAttribEncodings.get(j)
                    : null);
      }
      performances[i][0] = perfTuple.getPerformance();
    }
    setInputArray(inputData);
  }
View Full Code Here


    int sizeData = trainingData.size();
    Double[] perfLevels = new Double[classes - 1];
    Double perfArray[] = new Double[sizeData];

    for (int i = 0; i < perfArray.length; i++) {
      PerformanceTuple tuple = trainingData.get(i);
      perfArray[i] = tuple.getPerformance();
    }
    Arrays.sort(perfArray);

    int dataposition = sizeData / classes;
    for (int i = 1; i < classes; i++) {
View Full Code Here

    }

    // Average performance is 6th element
    double avgPerf = Double.parseDouble(tokens.get(5));

    return new PerformanceTuple(features, conf,
        TotalRuntimePerfMeasurerFactory.class, avgPerf);
  }
View Full Code Here

    List<PerformanceTuple> aggregatedTuples = new ArrayList<>();
    for (Entry<Long, Features> featuresEntry : featuresByProblem.entrySet()) {

      Long problemID = featuresEntry.getKey();
      PerformanceTuple newPerformanceTuple =
          new PerformanceTuple(featuresEntry.getValue(), config, null,
              calculateDesiredOutcome(oldFeaturesByProblem.get(problemID),
                  tuplesByProblem.get(problemID)));

      aggregatedTuples.add(newPerformanceTuple);
    }
View Full Code Here

    Features features = new Features();
    features.put(TEST_FEATURE, TEST_FEATURE_VALUE);
    Configuration configuration = new Configuration(null);
    configuration.put(TEST_CONFIG, TEST_CONFIG_VALUE);
    perfTuple =
        new PerformanceTuple(features, configuration,
            TotalRuntimePerfMeasurerFactory.class, 10);
  }
View Full Code Here

   */
  @Override
  protected void setUp() throws Exception {
    perfTuples = new ArrayList<>(100);
    for (int i = 0; i < 100; i++) {
      perfTuples.add(new PerformanceTuple(new Features(), new Configuration(
          null), TotalRuntimePerfMeasurerFactory.class, i + 1));
    }
  }
View Full Code Here

  /**
   * Tests generation of performance tuple.
   */
  public void testGeneratePerformanceTuple() {
    String sampleLine = "word__work_rng\t1.23\t5.00\t6.67";
    PerformanceTuple perfTuple =
        FileImportManager.generatePerformanceTuple(new Features(),
            FileImportManager.splitLine(sampleLine));
    assertEquals("word", perfTuple.getConfiguration()
        .get(FileImportManager.SIM));
    assertNull(perfTuple.getConfiguration().get(FileImportManager.SIMPARAMS));
    assertEquals("work", perfTuple.getConfiguration().get(FileImportManager.EQ));
    assertEquals("rng", perfTuple.getConfiguration().get(FileImportManager.RNG));
    assertEquals(5.00, perfTuple.getPerformance());
  }
View Full Code Here

    List<PerformanceTuple> tuples =
        FileImportManager.readProblemFile(TEST_FILE, testModelDescrption);
    assertEquals(162, tuples.size());

    PerformanceTuple testTuple = tuples.get(1);
    assertEquals("drm", testTuple.getConfiguration().get(FileImportManager.SIM));
    assertNull(testTuple.getConfiguration().get(FileImportManager.SIMPARAMS));
    assertNull(testTuple.getConfiguration().get(FileImportManager.EQ));
    assertEquals("isaac",
        testTuple.getConfiguration().get(FileImportManager.RNG));
    assertTrue(Math.abs(testTuple.getPerformance() - 37.98213) < 0.001);

    testTuple = tuples.get(41);
    assertEquals("nrma", testTuple.getConfiguration()
        .get(FileImportManager.SIM));
    assertNull(testTuple.getConfiguration().get(FileImportManager.SIMPARAMS));
    assertEquals("heap", testTuple.getConfiguration().get(FileImportManager.EQ));
    assertEquals("rwc", testTuple.getConfiguration().get(FileImportManager.RNG));
    assertTrue(Math.abs(testTuple.getPerformance() - 3.48973) < 0.001);
  }
View Full Code Here

  public void testTupleList() {
    PerformanceDataSet dataSet = fileManager.getPerformanceData();
    List<PerformanceTuple> tuples = dataSet.getInstances();
    assertEquals(344, tuples.size());
    PerformanceTuple testTuple = tuples.get(17);
    assertEquals("nrma", testTuple.getConfiguration()
        .get(FileImportManager.SIM));
    System.out.println("Eq:"
        + testTuple.getConfiguration().get(FileImportManager.EQ));
    assertEquals("2list", testTuple.getConfiguration()
        .get(FileImportManager.EQ));
    System.out.println("Rng:"
        + testTuple.getConfiguration().get(FileImportManager.RNG));
    assertEquals("rwc", testTuple.getConfiguration().get(FileImportManager.RNG));

  }
View Full Code Here

TOP

Related Classes of org.jamesii.asf.spdm.dataimport.PerformanceTuple

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.