7 #ifndef TREELITE_BASE_H_ 8 #define TREELITE_BASE_H_ 12 #include <unordered_map> 21 kNone, kNumerical, kCategorical
33 extern const std::unordered_map<std::string, Operator>
optable;
42 case Operator::kEQ:
return "==";
43 case Operator::kLT:
return "<";
44 case Operator::kLE:
return "<=";
45 case Operator::kGT:
return ">";
46 case Operator::kGE:
return ">=";
61 case Operator::kEQ:
return lhs == rhs;
62 case Operator::kLT:
return lhs < rhs;
63 case Operator::kLE:
return lhs <= rhs;
64 case Operator::kGT:
return lhs > rhs;
65 case Operator::kGE:
return lhs >= rhs;
67 throw std::runtime_error(
"operator undefined");
74 #endif // TREELITE_BASE_H_ SplitFeatureType
feature split type
bool CompareWithOp(tl_float lhs, Operator op, tl_float rhs)
perform comparison between two float's using a comparsion operator The comparison will be in the form...
float tl_float
float type to be used internally
std::string OpName(Operator op)
get string representation of comparsion operator
const std::unordered_map< std::string, Operator > optable
conversion table from string to operator, defined in optable.cc
Operator
comparison operators