Package org.jamesii.simspex.spdm.evaluation

Examples of org.jamesii.simspex.spdm.evaluation.SimpleDataSelector


    List<PerformanceTuple> data = dataSet.getInstances();
    int trainEndIndex = (int) Math.floor(data.size() * percentage);

    // Generate predictor
    IDataSelector trainingDataSelector =
        new SimpleDataSelector(0, trainEndIndex);
    List<PerformanceTuple> trainingData = trainingDataSelector.selectData(data);
    IPerformancePredictorGenerator predGen =
        predGenFactory.createPredictorGenerator(parameters, data.get(0));
    IPerformancePredictor predictor =
        predGen.generatePredictor(trainingData, dataSet.getMetaData());

    // Evaluate predictor
    IDataSelector testDataSelector =
        new SimpleDataSelector(trainEndIndex, data.size());
    List<PerformanceTuple> testData = testDataSelector.selectData(data);
    IPredictorEvaluator sev = new FullPredictorEvaluator();

    result.add(sev.evaluate(predictor, trainingData, testData, parameters));
    return result;
  }
View Full Code Here


   */
  private <T extends PerformanceTuple> List<T> getTestData(
      Map<Features, List<T>> featureMap, List<Features> allFeatures,
      int startIndex, int endIndex) {
    IDataSelector testDataSelector =
        new SimpleDataSelector(startIndex, endIndex);
    List<Features> testFeatures = testDataSelector.selectData(allFeatures);
    List<T> testData =
        PerformanceTuples.getTuplesForFeatures(featureMap, testFeatures);
    return testData;
  }
View Full Code Here

   * @return the training data
   */
  private <T extends PerformanceTuple> List<T> getTrainingData(
      Map<Features, List<T>> featureMap, List<Features> allFeatures,
      int startIndex, int endIndex) {
    IDataSelector trainingDataSelector = new SimpleDataSelector(0, startIndex);
    List<Features> trainingFeatures =
        trainingDataSelector.selectData(allFeatures);

    trainingDataSelector = new SimpleDataSelector(endIndex, allFeatures.size());
    trainingFeatures.addAll(trainingDataSelector.selectData(allFeatures));
    List<T> trainingData =
        PerformanceTuples.getTuplesForFeatures(featureMap, trainingFeatures);
    return trainingData;
  }
View Full Code Here

TOP

Related Classes of org.jamesii.simspex.spdm.evaluation.SimpleDataSelector

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.