-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMPSupervisedGestureRecognizer.h
48 lines (39 loc) · 1.92 KB
/
MPSupervisedGestureRecognizer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// MPSupervisedGestureRecognizer.h
// MPGestures
//
// Created by Matias Piipari on 12/01/2014.
// Copyright (c) 2014 de.ur. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MPStrokeSequenceRecognizer.h"
@class MPStrokeSequenceDatabase;
@protocol MPDataSet;
/** Abstract base class for supervised gesture recognizers. */
@interface MPSupervisedGestureRecognizer : NSObject <MPStrokeSequenceRecognizer>
/** An ordered collection of label values. */
@property (readonly) NSArray *labelValues;
/**
* Tests recognizing the labelled stroke sequences: outputs the recognitions and optionally a confusion matrix describing the misclassifications.
*
* @param strokeSequences The input stroke sequences, with labels drawn from the same set as the training data for the recognizer.
* @param confusionMatrix An optional pointer to a confusion matrix data table pointer that describes the misclassifications.
* @param precision An optional floating point value pointer to mark the overall classification precision.
* @return An array of MPStrokeSequenceRecognition objects.
*/
- (NSArray *)evaluateRecognizerWithStrokeSequences:(NSArray *)strokeSequences
confusionMatrix:(id<MPDataSet> *)confusionMatrix
precision:(float *)precision;
@end
@interface MPRandomForestGestureRecognizer : MPSupervisedGestureRecognizer
/**
* Initialises a gesture recogniser. Optionally limits the number of reference stroke sequences passed in.
*
* @param trainingDatabase Training dataset
* @param referenceDatabase Reference stroke sequence database
* @param maxSeqPerLabel Maximum number of sequences per label
*/
- (instancetype)initWithTrainingDatabase:(MPStrokeSequenceDatabase *)trainingDatabase
referenceSequenceDatabase:(MPStrokeSequenceDatabase *)referenceDatabase
maxReferenceSequencesPerLabel:(NSUInteger)maxSeqPerLabel;
@end