private void outputError(AlgorithmBase <double[][, ]> alg) { Console.WriteLine("Errors:"); var sample = new ClassifiedSample <double[][, ]>(); foreach (var obj in Data.Data) { var data = obj.Key; var key = new double[data.Length][, ]; for (int i = 0; i < data.Length; i++) { key[i] = new double[1, 1]; } for (int i = 0; i < data.Length; i++) { key[i][0, 0] = data[i]; } sample[key] = obj.Value; } var errors = alg.GetErrors(sample); var ec = errors.Count(); var dc = Data.Data.Count; var pct = Math.Round(100.0F * ec / dc, 2); Console.WriteLine("{0} of {1} ({2}%)", ec, dc, pct); }
private void outputError(AlgorithmBase <double[]> alg) { Console.WriteLine("Errors:"); var errors = alg.GetErrors(Data.Data); var ec = errors.Count(); var dc = Data.Data.Count; var pct = Math.Round(100.0F * ec / dc, 2); Console.WriteLine("{0} of {1} ({2}%)", ec, dc, pct); }