-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathScoreInfo.cpp
48 lines (41 loc) · 871 Bytes
/
ScoreInfo.cpp
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
/*
* ScoreInfo.cpp
* TTree
*
* Created by Vincent Botta on 16/12/08.
* Copyright 2008 University of Liège. All rights reserved.
*
*/
#include "ScoreInfo.h"
ScoreInfo::ScoreInfo() : attribute(-1), threshold(-1.0), score(-1.0), group(-1) {}
void ScoreInfo::update(int a,double t,double s) {
if (score < s) {
attribute = a;
threshold = t;
score = s;
}
}
void ScoreInfo::update(ClassicTree *t, double th, double s) {
if (score < s) {
threshold = th;
tree = t;
score = s;
}
}
void ScoreInfo::update(GStump *t, double th, double s) {
if (score < s) {
threshold = th;
stump = t;
score = s;
}
}
void ScoreInfo::update(Learner* w, double th, double s) {
if (score < s) {
threshold = th;
weak = w;
score = s;
}
}
void ScoreInfo::print() const {
fprintf(stderr,"Att:%4d\tTh: %1.2f\tScore: %1.5f\n",attribute,threshold,score);
}