Beispiel #1
0
        private void outputError(ClassificationAlgorithmBase <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, 0, true);
            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);
        }
Beispiel #2
0
        private void outputError(ClassificationAlgorithmBase <double[]> alg)
        {
            Console.WriteLine("Errors:");
            var errors = alg.GetErrors(Data.Data, 0, true);
            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);
        }