-
Notifications
You must be signed in to change notification settings - Fork 0
/
RandomForestManager.h
41 lines (35 loc) · 1.78 KB
/
RandomForestManager.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
//
// RandomForestManager.h
// Ride
//
// Created by William Henderson on 12/4/15.
// Copyright © 2015 Knock Softwae, Inc. All rights reserved.
//
#define RANDOM_FOREST_VECTOR_SIZE (13)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct RandomForestManager RandomForestManager;
struct AccelerometerReading {
float x;
float y;
float z;
double t; // seconds
};
typedef struct AccelerometerReading AccelerometerReading;
RandomForestManager *createRandomForestManagerFromJsonString(const char* jsonString);
RandomForestManager *createRandomForestManagerFromFile(const char* pathToJson);
bool randomForestLoadModel(RandomForestManager *r, const char* pathToModelFile);
float randomForestGetDesiredSessionDuration(RandomForestManager *r);
float randomForestGetDesiredSamplingInterval(RandomForestManager *r);
const char* randomForestGetModelUniqueIdentifier(RandomForestManager *r);
bool randomForestManagerCanPredict(RandomForestManager *r);
void deleteRandomForestManager(RandomForestManager *r);
void randomForestClassifyFeatures(RandomForestManager *randomForestManager, float* features, float* confidences, int n_classes);
bool randomForestClassifyAccelerometerSignal(RandomForestManager *randomForestManager, AccelerometerReading* signal, int readingCount, float* confidences, int n_classes);
bool randomForestPrepareFeaturesFromAccelerometerSignal(RandomForestManager *randomForestManager, AccelerometerReading* readings, int readingCount, float* features, int feature_count, float offsetSeconds);
int randomForestGetClassCount(RandomForestManager *randomForestManager);
int randomForestGetClassLabels(RandomForestManager *randomForestManager, int *labels, int classCount);
#ifdef __cplusplus
}
#endif