Ejemplo n.º 1
0
        private ConfusionMatrix <ShapeType> computeRecognitionConfusionMatrix()
        {
            ConfusionMatrix <ShapeType> result = new ConfusionMatrix <ShapeType>();

            foreach (Sketch.Shape correctShape in _original.Shapes)
            {
                ShapeType originalType = correctShape.Type;

                if (_toCompare.ShapesL.Exists(delegate(Sketch.Shape s) { return(s.Equals(correctShape)); }))
                {
                    Sketch.Shape resultShape = _toCompare.ShapesL.Find(delegate(Sketch.Shape s) { return(s.Equals(correctShape)); });
                    ShapeType    resultType  = resultShape.Type;

                    // Record stats
                    result.increment(originalType, resultType);
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        private ConfusionMatrix <string> computeClassificationConfusionMatrix()
        {
            ConfusionMatrix <string> result = new ConfusionMatrix <string>();

            foreach (Substroke correctStroke in _original.Substrokes)
            {
                if (IGNORE_CLASSIFICATIONS.Contains(correctStroke.Classification.ToLower()))
                {
                    continue;
                }

                string originalClass = correctStroke.Classification;

                Substroke resultStroke = _toCompare.SubstrokesL.Find(delegate(Substroke s) { return(s.GeometricEquals(correctStroke)); });
                string    resultClass  = resultStroke.Classification;

                // Record stats
                result.increment(originalClass, resultClass);
            }

            return(result);
        }