-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipeline.c
More file actions
29 lines (23 loc) · 927 Bytes
/
pipeline.c
File metadata and controls
29 lines (23 loc) · 927 Bytes
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
#include "pipeline.h"
uint16_t pred_class;
uint16_t pipeline(fixed max_samples[MEMORY_SIZE+UPDATE_THR][N_FEATURE], struct Node* root, uint16_t y_train[MEMORY_SIZE+UPDATE_THR], uint16_t n_samples, uint16_t counter)
{
uint16_t i,j;
for(i = 0; i < UPDATE_THR; i++) {
#ifdef AUTO_DT
pred_class = decision_tree_classifier(root, X_train[i + counter - UPDATE_THR]);
#endif
#ifdef AUTO_KNN
pred_class = knn_classification(X_train[i + counter - UPDATE_THR], max_samples, y_train, n_samples);
#endif
#ifdef AUTO_PRC
pred_class = perceptron_classification(X_train[i + counter - UPDATE_THR]);
#endif
}
for(i = 0; i < UPDATE_THR; i++) {
for(j = 0; j < N_FEATURE; j++)
max_samples[n_samples + i][j] = X_train[i + counter - UPDATE_THR][j];
}
n_samples += UPDATE_THR;
return n_samples;
}