21 #ifndef _REAL_DECISION_STUMP_H
22 #define _REAL_DECISION_STUMP_H
41 template<
class DataType>
51 typedef float ReturnType;
58 static std::string signature() {
return "realdecisionstump"; }
63 return (value >
th) ?
pr : nr;
68 inline void rescale(
int sx,
int sy,
int sgn)
71 th = (int) (
th*sx*sy)*sgn;
77 return std::max(std::abs(
pr), std::abs(nr));
83 template<
class DataType>
86 in >> s.
th >> s.
pr >> s.nr;
90 template<
class DataType>
91 inline std::ostream & operator << (std::ostream & out, const RealDecisionStump<DataType> & s)
93 out << s.th <<
' ' << s.pr <<
' ' << s.nr;
void rescale(int sx, int sy, int sgn)
this function permits to change the th for rescaling
Definition: RealDecisionStump.h:68
Types involved in boosting.
static const ClassifierType Type
NaiveDecisionStump is a DiscreteClassifier.
Definition: RealDecisionStump.h:54
ClassifierType
Definition: Types.h:31
float pr
weight associated to positive response (pr) and negative response (nr)
Definition: RealDecisionStump.h:48
A Weak Classifier based on a Feature Extractor policy.
Definition: RealDecisionStump.h:42
float evaluate_feature(DataType value) const
convert the feature value to {p,n} using internal parity and threshold
Definition: RealDecisionStump.h:61
a real classifier return a number between -1,+1
Definition: Types.h:34
DataType th
threshold value
Definition: RealDecisionStump.h:45
float getAlpha() const
return the maximum range of data returned
Definition: RealDecisionStump.h:76