GeneralizedOptimalSparseDecisionTrees
GeneralizedOptimalSparseDecisionTrees copied to clipboard
Fix bug when converting OSDT leaves into a Text Classifier compatible…
There is a bug when trying to validate if a leaf exists in the features dict. Essentially, a leaf is a tuple with form:
(feature_1, feature_2, ..., feature_n)
and the keys and values of the features dict has the form:
key = feature
value = frequency
where
feature: int
frequency: int
So the original if-else statement, tried to validate if a tuple was in features, however features only contain integers for key and values. For some specific cases, it returned an empty dict which turn out into a recursivity problem.