Skip to content

Commit

Permalink
Address remaining comments
Browse files Browse the repository at this point in the history
  • Loading branch information
izeigerman committed Feb 8, 2019
1 parent eb75012 commit f340465
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions m2cgen/assemblers/xgboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def _assemble_tree(self, tree):
feature_idx = self._feature_name_to_idx[tree["split"]]
feature_ref = ast.FeatureRef(feature_idx)

# Since comparison with NaN (missing) value always returns false we
# should make sure that the node ID specified in the "missing" field
# always ends up in the "else" branch of the ast.IfExpr.
use_lt_comp = tree["missing"] == tree["no"]
if use_lt_comp:
comp_op = ast.CompOpType.LT
Expand Down
2 changes: 2 additions & 0 deletions m2cgen/interpreters/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def interpret(self, expr):
self._reset_reused_expr_cache()
return self._do_interpret(expr)

# Private methods implementing Visitor pattern

def _pre_interpret_hook(self, expr, **kwargs):
return None, kwargs

Expand Down

0 comments on commit f340465

Please sign in to comment.