forked from aesuli/mp-boost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpredictionset.h
50 lines (39 loc) · 1.47 KB
/
predictionset.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
49
50
/************************************************************************/
/* */
/* MPBoost++ */
/* */
/* Copyright: Andrea Esuli */
/* Date: 16 august 2010 */
/* License and Info: http://www.esuli.it/ */
/* */
/************************************************************************/
#ifndef _PREDICTIONSET_H_
#define _PREDICTIONSET_H_
#include <vector>
#include <istream>
#include "prediction.h"
class PredictionSet: public std::vector<Prediction *> {
public:
PredictionSet():categoryCount(0) {}
PredictionSet(int categoryCount):
categoryCount(categoryCount) {}
~PredictionSet() {
std::vector<Prediction *>::const_iterator it = begin();
std::vector<Prediction *>::const_iterator tend = end();
while(it!=tend) {
delete *it;
++it;
}
}
inline int GetCategoryCount() { return categoryCount; }
/** Data format, one prediction per line:
<Evaluation 0>
..
<Evaluation n>
*/
static PredictionSet * Read(std::istream & in);
void Write(std::ostream & out);
private:
int categoryCount;
};
#endif // _PREDICTIONSET_H_