Skip to content

Commit

Permalink
fix: use already extracted tree dataframe instead of extracting it ag…
Browse files Browse the repository at this point in the history
…ain (#182)
  • Loading branch information
Demetrio92 authored Apr 29, 2022
1 parent e2cb111 commit cb9d253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dtreeviz/models/xgb_decision_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def _get_tree_dataframe(self):
return self.booster.trees_to_dataframe().query(f"Tree == {self.tree_index}")

def _get_column_value(self, column_name):
return self._get_tree_dataframe()[column_name].to_numpy()
return self.tree_to_dataframe[column_name].to_numpy()

def _get_nodes_values(self, column_name):
nodes = self._get_column_value(self.NODE_COLUMN)
Expand Down

0 comments on commit cb9d253

Please sign in to comment.