static void Main(string[] args)
        {
            var distance = new ManhattanDistance();
            var classifier = new BasicClassifier(distance);

            var trainingPath = @"..\..\..\Data\trainingsample.csv";
            var training = DataReader.ReadObservations(trainingPath);
            classifier.Train(training);

            var validationPath = @"..\..\..\Data\validationsample.csv";
            var validation = DataReader.ReadObservations(validationPath);

            var correct = Evaluator.Correct(validation, classifier);
            Console.WriteLine("Correctly classified: {0:P2}", correct);

            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            var distanceAlgorithm = new ManhattanDistance();
            var classifier = new BasicClassifier(distanceAlgorithm);

            var trainingPath = @"G:\Projects\MachineLearning\DigitRecognizer\CSharp\Data\trainingsample.csv";
            var trainingSet = DataReader.ReadObservations(trainingPath);
            classifier.Train(trainingSet);

            var validationPath = @"G:\Projects\MachineLearning\DigitRecognizer\CSharp\Data\validationsample.csv";
            var validationSet = DataReader.ReadObservations(validationPath);

            var correctPercentage = Evaluator.Correct(validationSet, classifier);
            Console.WriteLine("Percentage of correctly classified images: {0:P2}", correctPercentage);

            Benchmark(() => Evaluator.Correct(validationSet, classifier), 1);

            Console.ReadLine();
        }