Package org.encog.ml.data.buffer

Examples of org.encog.ml.data.buffer.BinaryDataLoader


      if (ExtensionFilter.getExtension(binaryFile) == null) {
        binaryFile = new File(binaryFile.getPath() + ".egb");
      }

      DataSetCODEC codec;
      BinaryDataLoader loader;

      if (fileType == 0) {
        DialogCSV dialog2 = new DialogCSV(EncogWorkBench.getInstance()
            .getMainWindow());
        if (dialog2.process()) {
          boolean headers = dialog2.getHeaders().getValue();
          CSVFormat format;

          if (dialog2.getDecimalComma().getValue())
            format = CSVFormat.DECIMAL_COMMA;
          else
            format = CSVFormat.DECIMAL_POINT;

          codec = new CSVDataCODEC(externFile, format, headers,
              inputCount, idealCount, dialog.getContainsSignificance().getValue());
          loader = new BinaryDataLoader(codec);
          ImportExportDialog dlg = new ImportExportDialog(loader,
              binaryFile, true);
          dlg.process(done);
        }
      } else if (fileType == 1) {
        codec = new ExcelCODEC(externFile,
            inputCount, idealCount);
        loader = new BinaryDataLoader(codec);
        ImportExportDialog dlg = new ImportExportDialog(loader,
            binaryFile, true);
        dlg.process(done);
      }     
      return binaryFile;
View Full Code Here


    if (dialog.process()) {
      File binaryFile = new File(dialog.getBinaryFile().getValue());
      File externFile = new File(dialog.getExternalFile().getValue());
      int fileType = dialog.getFileType().getSelectedIndex();
      DataSetCODEC codec;
      BinaryDataLoader loader;

      if (fileType == 0) {
        DialogCSV dialog2 = new DialogCSV(EncogWorkBench.getInstance()
            .getMainWindow());
        if (dialog2.process()) {
          boolean headers = dialog2.getHeaders().getValue();
          CSVFormat format;

          if (dialog2.getDecimalComma().getValue())
            format = CSVFormat.DECIMAL_COMMA;
          else
            format = CSVFormat.DECIMAL_POINT;

          codec = new CSVDataCODEC(externFile, format,
              dialog2.getGenerateSignificance().getValue());
          loader = new BinaryDataLoader(codec);

          ImportExportDialog dlg = new ImportExportDialog(loader,
              binaryFile, false);
          dlg.process(done);
        }
      } else if (fileType == 1) {
        codec = new ExcelCODEC(externFile);
        loader = new BinaryDataLoader(codec);

        ImportExportDialog dlg = new ImportExportDialog(loader,
            binaryFile, false);
        dlg.process(done);
View Full Code Here

public class TestExcel extends TestCase {
  public void testXLSX() {
    final ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,
        XOR.XOR_IDEAL);
    final BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));

    final ExcelCODEC codec2 = new ExcelCODEC(new File("encog.xlsx"));
    final BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));

    final ExcelCODEC codec3 = new ExcelCODEC(new File("encog.xlsx"), 2, 1);
    final BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
    loader3.external2Binary(new File("encog.bin"));

    final ArrayDataCODEC codec4 = new ArrayDataCODEC();
    final BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
    loader4.binary2External(new File("encog.bin"));

    final double[][] input = codec4.getInput();
    final double[][] ideal = codec4.getIdeal();

    for (int i = 0; i < XOR.XOR_INPUT.length; i++) {
View Full Code Here

public class TestBinaryData extends TestCase {
 
  public void testArrayCODEC() throws Exception
  {
    ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));
 
    ArrayDataCODEC codec2 = new ArrayDataCODEC();
    BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));
   
    double[][] input = codec2.getInput();
    double[][] ideal = codec2.getIdeal();
   
    for(int i=0;i<XOR.XOR_INPUT.length;i++)
View Full Code Here

  }
 
  public void testCSV()
  {
    ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));
 
    CSVDataCODEC codec2 = new CSVDataCODEC(new File("encog.csv"), CSVFormat.ENGLISH, false);
    BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));
   
    CSVDataCODEC codec3 = new CSVDataCODEC(new File("encog.csv"), CSVFormat.ENGLISH, false, 2, 1, false);
    BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
    loader3.external2Binary(new File("encog.bin"));

    ArrayDataCODEC codec4 = new ArrayDataCODEC();
    BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
    loader4.binary2External(new File("encog.bin"));
   
    double[][] input = codec4.getInput();
    double[][] ideal = codec4.getIdeal();
   
    for(int i=0;i<XOR.XOR_INPUT.length;i++)
View Full Code Here

public class TestExcel extends TestCase {
  public void testXLSX() {
    final ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,
        XOR.XOR_IDEAL);
    final BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));

    final ExcelCODEC codec2 = new ExcelCODEC(new File("encog.xlsx"));
    final BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));

    final ExcelCODEC codec3 = new ExcelCODEC(new File("encog.xlsx"), 2, 1);
    final BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
    loader3.external2Binary(new File("encog.bin"));

    final ArrayDataCODEC codec4 = new ArrayDataCODEC();
    final BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
    loader4.binary2External(new File("encog.bin"));

    final double[][] input = codec4.getInput();
    final double[][] ideal = codec4.getIdeal();

    for (int i = 0; i < XOR.XOR_INPUT.length; i++) {
View Full Code Here

public class TestBinaryData extends TestCase {
 
  public void testArrayCODEC() throws Exception
  {
    ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));
 
    ArrayDataCODEC codec2 = new ArrayDataCODEC();
    BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));
   
    double[][] input = codec2.getInput();
    double[][] ideal = codec2.getIdeal();
   
    for(int i=0;i<XOR.XOR_INPUT.length;i++)
View Full Code Here

  }
 
  public void testCSV()
  {
    ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));
 
    CSVDataCODEC codec2 = new CSVDataCODEC(new File("encog.csv"), CSVFormat.ENGLISH, false);
    BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));
   
    CSVDataCODEC codec3 = new CSVDataCODEC(new File("encog.csv"), CSVFormat.ENGLISH, false, 2, 1, false);
    BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
    loader3.external2Binary(new File("encog.bin"));

    ArrayDataCODEC codec4 = new ArrayDataCODEC();
    BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
    loader4.binary2External(new File("encog.bin"));
   
    double[][] input = codec4.getInput();
    double[][] ideal = codec4.getIdeal();
   
    for(int i=0;i<XOR.XOR_INPUT.length;i++)
View Full Code Here

TOP

Related Classes of org.encog.ml.data.buffer.BinaryDataLoader

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.