//OVERRIDES DEFAULTA RESULT PROCESSING public override String ProcessTestSetResults(Matrix <double> testSetInput, Matrix <double> testSetOutput, Matrix <double> testSetPredictedOutcome) { double accError = 0; int failures = 0; int canNotDefine = 0; String txt = "Testing Set Results\r\n\r\n"; for (int i = 0; i < testSetPredictedOutcome.RowCount; i++) { var realResult = WheatSeed.EstimateSpecie(testSetOutput.Row(i).ToArray()); var estimatedResult = WheatSeed.EstimateSpecie(testSetPredictedOutcome.Row(i).ToArray()); var error = EstimationItemError(testSetPredictedOutcome.Row(i)); string result = String.Empty; if (estimatedResult == WheatSeed.WheatSeedSpecies.Unknown) { canNotDefine++; result = "[UNDEFINED]"; } else { if (estimatedResult != realResult) { failures++; result = "[ERROR]"; } } result += "Real Output was " + realResult.ToString() + " estimation was " + estimatedResult.ToString() + "[Error:" + Math.Round(error, 5) + "]\r\n"; txt += result; accError += error; } txt += "\r\n\r\nAverage Estimation Error: " + (accError / testSetPredictedOutcome.RowCount).ToString(); txt += "\r\nTotal Errors: " + failures + " out of " + testSetPredictedOutcome.RowCount + " samples [" + Math.Round((double)(100 * failures / testSetPredictedOutcome.RowCount), 2) + "%]"; txt += "\r\nTotal Undefined: " + canNotDefine + " out of " + testSetPredictedOutcome.RowCount + " samples [" + Math.Round((double)(100 * canNotDefine / testSetPredictedOutcome.RowCount), 2) + "%]"; return(txt); }
new const double defaultErrorThreshold = 0.25; //Override BaseClass DefaultErrorThreshold public WheatSeedDataSets(double percentageOfTestingData = defaultPercentageOfTestingData) { InputNeuronNames = WheatSeed.GetInputVariablesList(); OutputNeuronNames = WheatSeed.GetOutputVariablesList(); }