Exemple #1
0
 bool FindZeroPoint(ROCCurve ROC, ErrorPolicy.Evaluate policy, ref ROCPoint left, ref ROCPoint right)
 {
     for (int i = 0; i < ROC.Curve.Count; ++i)
     {
         if (policy(ROC.Curve[i]) == 0)
         {
             left = right = ROC.Curve[i];
             return(true);
         }
     }
     return(false);
 }
Exemple #2
0
 void FindMinMax(ROCCurve ROC, ErrorPolicy.Evaluate policy, out ROCPoint left, out ROCPoint right)
 {
     left  = new ROCPoint();
     right = new ROCPoint();
     if (CheckForNoZero(ROC, policy, ref left, ref right))
     {
         return;
     }
     if (FindZeroPoint(ROC, policy, ref left, ref right))
     {
         return;
     }
     if (FindZeroPair(ROC, policy, ref left, ref right))
     {
         return;
     }
     throw new AssertException();
 }
Exemple #3
0
        bool CheckForNoZero(ROCCurve ROC, ErrorPolicy.Evaluate policy, ref ROCPoint left, ref ROCPoint right)
        {
            float first = policy(ROC.Curve[0]);
            float last  = policy(ROC.Curve[ROC.Curve.Count - 1]);

            if (first > 0 && last > 0 || first < 0 && last < 0)
            {
                if (Math.Abs(first) < Math.Abs(last))
                {
                    left = right = ROC.Curve[0];
                }
                else
                {
                    left = right = ROC.Curve[ROC.Curve.Count - 1];
                }
                return(true);
            }
            return(false);
        }
 public abstract float Measure(ROCPoint point);
 public override float Measure(ROCPoint point)
 {
     return((point.FAR + point.FRR) / 2);
 }
 public override float Measure(ROCPoint point)
 {
     return(point.FAR);
 }