private void _buttonLoad_Click(object sender, EventArgs e) { _nn = MemoryBasedNeuronNetwork.Make(4); LoadRacesForImprovementSelection(); _nn.AddTrainingPatterns(_startersForTraining); double correct = 0, wrong = 0; int counter = 0; foreach (var starterInfo in _startersForTesting) { double opinion = _nn.GetOpinion(starterInfo); bool breaksPersonalRecord = starterInfo.BreaksPersonalRecord; if(opinion > 0) { if(breaksPersonalRecord) { ++correct; } else { ++wrong; } } if(0 == ++counter % 100) { WriteLine(string.Format(" {0} Correct {1} Wrong {2}", counter,correct, wrong)); } } WriteLine(string.Format("Correct {0} Wrong {1}", correct, wrong)); }
public static bool CheckIfStarterWillImprove(StarterInfo si) { if(null == _singleton) { _singleton = new MemoryBasedNeuronNetwork(4); _singleton.AddTrainingPatterns(StarterInfo.LoadStartersFromFile(@"C:\Users\John\Desktop\neural_network.csv", 4)); } return _singleton.GetOpinion(si) > 0; }