isCorrect() public method

public isCorrect ( Vector prediction ) : bool
prediction AIMA.Core.Util.Math.Vector
return bool
示例#1
0
 public int[] testOnDataSet(NNDataSet nnds)
 {
     int[] result = new int[] { 0, 0 };
     nnds.refreshDataset();
     while (nnds.hasMoreExamples())
     {
         NNExample nne        = nnds.getExampleAtRandom();
         Vector    prediction = predict(nne);
         if (nne.isCorrect(prediction))
         {
             result[0] = result[0] + 1;
         }
         else
         {
             result[1] = result[1] + 1;
         }
     }
     return(result);
 }