예제 #1
0
 public async Task PerformCalculations(int k)
 {
     await Task.Run(() =>
     {
         solution = KNN.PerformKnn(dataSet, unknownFaces, k);
         FileLoader.CopyAnswers(solution, answerPath);
     });
 }
예제 #2
0
파일: Program.cs 프로젝트: aol1306/kNN
        static void Main(string[] args)
        {
            // This test does not make much sense, but at least it proves the code works
            var knn = new KNN(TrainingData.GenerateForNumbers(), 2);

            foreach (TrainingData training in TrainingData.GenerateForNumbers())
            {
                Console.WriteLine(String.Format("Expected: {0}, Got: {1}", training.classification, knn.Classify(training.inputs)));
            }
        }