Skip to content

Commit

Permalink
Merge pull request #90 from qrsforever/master
Browse files Browse the repository at this point in the history
fix bug: check model attrs
  • Loading branch information
parrt committed Jun 4, 2020
2 parents be7fcce + 2154371 commit b38b3cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dtreeviz/shadow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, tree_model,
self.class_names = class_names
self.class_weight = tree_model.class_weight

if getattr(tree_model, 'tree_') is None: # make sure model is fit
if not hasattr(tree_model, 'tree_'): # make sure model is fit
tree_model.fit(X_train, y_train)

if tree_model.tree_.n_classes > 1:
Expand Down

0 comments on commit b38b3cc

Please sign in to comment.