public Load ( IMLDataSet training ) : void | ||
training | IMLDataSet | The training set to load. |
return | void |
/// <summary> /// Save the training set to an EGB file. /// </summary> /// <param name="egbFile">The EGB file to save to.</param> /// <param name="data">The training data to save.</param> public static void SaveEGB(FileInfo egbFile, IMLDataSet data) { var binary = new BufferedMLDataSet(egbFile.ToString()); binary.Load(data); data.Close(); }
/// <summary> /// Evaluate disk. /// </summary> private void EvalBinary() { FileInfo file = FileUtil.CombinePath( new FileInfo(Path.GetTempPath()), "temp.egb" ); BasicMLDataSet training = RandomTrainingFactory.Generate( 1000, 10000, 10, 10, -1, 1); // create the binary file if (file.Exists) { file.Delete(); } var training2 = new BufferedMLDataSet(file.ToString()); training2.Load(training); const long stop = (10*Evaluate.Milis); int record = 0; IMLDataPair pair; var watch = new Stopwatch(); watch.Start(); int iterations = 0; while(true) { iterations++; pair = training[record++]; if(record >= training.Count) record = 0; if((iterations & 0xff) == 0 && watch.ElapsedMilliseconds >= stop) break; } training2.Close(); iterations /= 100000; _report.Report(Steps, Step3, "Disk(binary) dataset, result: " + Format.FormatInteger(iterations)); if (file.Exists) { file.Delete(); } _binaryScore = iterations; }