예제 #1
0
 public TestResult Predict(DetectedPoints pts)
 {
     TestResult result = new TestResult();
     Dictionary<Label, double> results = new Dictionary<Label,double>();
     foreach (var a in library) {
         double comparison = a.Value.Compare(pts);
         results[a.Key] = comparison;
     }
     result.Add(results);
     return result;
 }
예제 #2
0
 internal void Train(DetectedPoints pts, Label label, TestResult result)
 {
     if (!library.ContainsKey(label)) {
         library[label] = pts;
     } else {
         var baseVal = library[label].Compare(pts);
         foreach (var a in library) {
             if (a.Key == label) continue;
             var a1 = a.Value.Compare(pts);
             if (a1 > baseVal) {
                 a.Value.Sanitize(pts);
             }
         }
     }
 }
예제 #3
0
        /// <summary>
        /// At this point we pretend that we don't know the correct output label for the most recent piece of data
        /// </summary>
        public TestResult Predict()
        {
            TestResult result = new TestResult();
            List<int> indicesToRegenerate = new List<int>();
            int i = 0;
            foreach (var a in Features) {
                double eval = a.Evaluate(featureContext);
                var output = a.Apply(eval, utilThreshold);
                //if (output.Count() == 0 && a.stats.Count() > 3) {
                //    indicesToRegenerate.Add(i);
                //}
                i++;
                result.Add(output);
            }

            for (int j = 0; j < indicesToRegenerate.Count(); j++) {
                Features[indicesToRegenerate[j]].Regenerate(30, this.Width, this.Height);
            }
            return result;
        }
예제 #4
0
 internal void Add(TestResult output)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 ///Knows how successul we have been
 ///Probability returned for correct assignment vs. probability
 ///returned for an incorrect assignment
 internal void Push(TestResult result, Label Label)
 {
     throw new NotImplementedException();
 }