/// <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);
var egb = new EncogEGBFile(binaryFile);
egb.Create(_codec.InputSize, _codec.IdealSize);
var input = new double[_codec.InputSize];
var ideal = new double[_codec.IdealSize];
_codec.PrepareRead();
int currentRecord = 0;
int lastUpdate = 0;
double significance = 0;
while (_codec.Read(input, ideal, ref significance))
{
egb.Write(input);
egb.Write(ideal);
currentRecord++;
lastUpdate++;
if (lastUpdate >= 10000)
{
lastUpdate = 0;
Status.Report(0, currentRecord, "Importing...");
}
egb.Write(significance);
}
egb.Close();
_codec.Close();
Status.Report(0, 0, "Done importing to binary file: "
+ binaryFile);
}