public void SanFranciscoCrimeClassificationTestDataSetTest() { DataSetLoader dataSetLoader = new DataSetLoader(); Console.WriteLine(" Reading DataSet.. "); var crimes = dataSetLoader.SelectNeuronalNetworkCrimes(); //DecisionTreeClassifier decisionTreeClassifier = //new DecisionTreeClassifier(crimes, new ShannonEntropySplitter()); NeuronalNetworkClassifier neuronalNetworkClassifier = new NeuronalNetworkClassifier(crimes, 2, 38, 2, 5000, 0.1); //Kernel kernel = new LinearKernel(); //NaiveBayesClassifier naiveBayes = // new NaiveBayesClassifier(crimes); neuronalNetworkClassifier.Train(); var crimeTests = dataSetLoader.SelectCrimes(); var trueCounter = 0; var counter = 0; foreach (var item in crimeTests) { var outputValue = neuronalNetworkClassifier.ClassifiyMultibleResultValue(item.Item1); var resultString = String.Empty; double maxValue = 0.0; int innerCounter = 0; int maxItem = 0; foreach (var value in outputValue) { if (value > maxValue) { maxValue = value; maxItem = innerCounter; } innerCounter++; } if (maxItem == item.Item2) { trueCounter++; } Debug.WriteLine(string.Format("Value {0} - Predicted {1} = {2}", item.Item2, maxItem, (maxItem == item.Item2) ? "true" : "false")); counter++; } Debug.WriteLine(string.Format("Data {0} - True {1} Verhältnis: {2}", counter.ToString(), trueCounter.ToString(), (Convert.ToDouble(trueCounter) / Convert.ToDouble(counter)).ToString())); }