7 #ifndef TREELITE_BASE_H_ 8 #define TREELITE_BASE_H_ 13 #include <unordered_map> 23 kNone, kNumerical, kCategorical
36 extern const std::unordered_map<std::string, Operator>
optable;
45 case Operator::kEQ:
return "==";
46 case Operator::kLT:
return "<";
47 case Operator::kLE:
return "<=";
48 case Operator::kGT:
return ">";
49 case Operator::kGE:
return ">=";
62 template <
typename ElementType,
typename ThresholdType>
65 case Operator::kEQ:
return lhs == rhs;
66 case Operator::kLT:
return lhs < rhs;
67 case Operator::kLE:
return lhs <= rhs;
68 case Operator::kGT:
return lhs > rhs;
69 case Operator::kGE:
return lhs >= rhs;
71 throw std::runtime_error(
"operator undefined");
78 #endif // TREELITE_BASE_H_ SplitFeatureType
feature split type
float tl_float
float type to be used internally
std::string OpName(Operator op)
get string representation of comparison operator
bool CompareWithOp(ElementType lhs, Operator op, ThresholdType rhs)
perform comparison between two float's using a comparsion operator The comparison will be in the form...
Defines TypeInfo class and utilities.
const std::unordered_map< std::string, Operator > optable
conversion table from string to Operator, defined in tables.cc
Operator
comparison operators