/// <summary> /// Add only input data, for an unsupervised dataset. /// </summary> /// <param name="data1">The data to be added.</param> public void Add(INeuralData data1) { if (!this.loading) { throw new NeuralDataError(BufferedNeuralDataSet.ERROR_ADD); } egb.Write(data1.Data); }
/// <summary> /// Convert an external file format, such as CSV, to the Encog binary /// training format. /// </summary> /// <param name="binaryFile">The binary file to create.</param> public void External2Binary(String binaryFile) { Status.Report(0, 0, "Importing to binary file: " + binaryFile); EncogEGBFile egb = new EncogEGBFile(binaryFile); egb.Create(codec.InputSize, codec.IdealSize); double[] input = new double[this.codec.InputSize]; double[] ideal = new double[this.codec.IdealSize]; this.codec.PrepareRead(); int index = 3; int currentRecord = 0; int lastUpdate = 0; while (codec.Read(input, ideal)) { egb.Write(input); egb.Write(ideal); index += input.Length; index += ideal.Length; currentRecord++; lastUpdate++; if (lastUpdate >= 10000) { lastUpdate = 0; this.Status.Report(0, currentRecord, "Importing..."); } } egb.Close(); this.codec.Close(); Status.Report(0, 0, "Done importing to binary file: " + binaryFile); }