Medial Code Documentation
Loading...
Searching...
No Matches
MedPerformance_imp.h
1// Implementation of template functions for class MedPerformance.
2
3
4// Init from array
5template <typename T, typename S> MedClassifierPerformance::MedClassifierPerformance(T *preds, S *labels, int n) {
6 load(preds,labels,n) ;
7}
8
9// Load from arrays
10template <typename T, typename S> void MedClassifierPerformance::load(T *_preds, S *_labels, int n) {
11
12 preds.resize(1) ;
13 preds[0].resize(n) ;
14 for (int i=0; i<n; i++) {
15 pair<float,float> current((float) _preds[i],(float) _labels[i]) ;
16 preds[0][i] = current ;
17 }
18
19 init() ;
20 ShuffleSort() ;
21 getPerformanceValues() ;
22
23 PerformancePointers.resize(preds.size()) ;
24}
25
26// Init from object
27template <typename T> MedClassifierPerformance::MedClassifierPerformance(T& inObj) {
28 load(inObj) ;
29}
30
31// Load from object
32template <typename T> void MedClassifierPerformance::load(T& inObj) {
33
34 _load(inObj) ;
35 post_load();
36}
37
38
39
40