Package org.encog.app.analyst.csv.basic

Examples of org.encog.app.analyst.csv.basic.LoadedRow


      final PrintWriter tw = prepareOutputFile(target.getFilename());

      while ((target.getNumberRemaining() > 0) && csv.next()
          && !shouldStop()) {
        updateStatus(false);
        final LoadedRow row = new LoadedRow(csv);
        writeRow(tw, row);
        target.setNumberRemaining(target.getNumberRemaining() - 1);
      }

      tw.close();
View Full Code Here


    this.filteredCount = 0;

    resetStatus();
    while (csv.next() && !shouldStop()) {
      updateStatus(false);
      final LoadedRow row = new LoadedRow(csv);
      if (shouldProcess(row)) {
        writeRow(tw, row);
        this.filteredCount++;
      }
    }
View Full Code Here

    final PrintWriter tw = analystPrepareOutputFile(outputFile);

    resetStatus();
    while (csv.next()) {
      updateStatus(false);
      final LoadedRow row = new LoadedRow(csv, this.idealCount);

      int dataIndex = 0;
      // load the input data
      for (int i = 0; i < this.inputCount; i++) {
        final String str = row.getData()[i];
        final double d = getInputFormat().parse(str);
        input.setData(i, d);
        dataIndex++;
      }

      // do we need to skip the ideal values?
      dataIndex += this.idealCount;

      // compute the result
      output = method.compute(input);

      // display the computed result
      for (int i = 0; i < this.outputCount; i++) {
        final double d = output.getData(i);
        row.getData()[dataIndex++] = getInputFormat().format(d,
            getPrecision());
      }

      writeRow(tw, row);
    }
View Full Code Here

    final ReadCSV csv = new ReadCSV(getInputFilename().toString(),
        isExpectInputHeaders(), getInputFormat());

    resetStatus();
    while (csv.next() && !shouldStop()) {
      final LoadedRow row = new LoadedRow(csv);
      updateStatus(false);
      final String key = row.getData()[targetField];
      int count;
      if (!this.counts.containsKey(key)) {
        count = 0;
      } else {
        count = this.counts.get(key);
View Full Code Here

    this.analystHeaders = new CSVHeaders(this.getInputHeadings());

    while (csv.next() && !shouldStop()) {
      updateStatus(true);

      final LoadedRow row = new LoadedRow(csv, 1);

      final double[] inputArray = AnalystNormalizeCSV.extractFields(
          analyst, this.analystHeaders, csv, outputLength, true);
      final ClusterRow input = new ClusterRow(inputArray, row);
      this.data.add(input);
View Full Code Here

    }

    while (this.remaining > 0) {
      final int index = RangeRandomizer.randomInt(0, this.bufferSize - 1);
      if (this.buffer[index] != null) {
        final LoadedRow result = this.buffer[index];
        this.buffer[index] = null;
        this.remaining--;
        return result;
      }
    }
View Full Code Here

      this.buffer[i] = null;
    }

    int index = 0;
    while (csv.next() && (index < this.bufferSize) && !shouldStop()) {
      final LoadedRow row = new LoadedRow(csv);
      this.buffer[index++] = row;
    }

    this.remaining = index;
  }
View Full Code Here

    int clusterNum = 0;
    for (final MLCluster cl : cluster.getClusters()) {
      for (final MLData item : cl.getData()) {
        final ClusterRow row = (ClusterRow) item;
        final int clsIndex = row.getInput().size() - 1;
        final LoadedRow lr = row.getRow();
        lr.getData()[clsIndex] = "" + clusterNum;
        writeRow(tw, lr);
      }
      clusterNum++;
    }
View Full Code Here

  public final void process(final File outputFile) {
    validateAnalyzed();

    final ReadCSV csv = new ReadCSV(getInputFilename().toString(),
        isExpectInputHeaders(), getInputFormat());
    LoadedRow row;

    final PrintWriter tw = prepareOutputFile(outputFile);

    resetStatus();
    while ((row = getNextRow(csv)) != null) {
View Full Code Here

    final ReadCSV csv = new ReadCSV(getInputFilename().toString(),
        isExpectInputHeaders(), getInputFormat());
    while (csv.next() && !shouldStop()) {
      updateStatus("Reading input file");
      final LoadedRow row = new LoadedRow(csv);
      this.data.add(row);
    }

    setColumnCount(csv.getColumnCount());
View Full Code Here

TOP

Related Classes of org.encog.app.analyst.csv.basic.LoadedRow

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.