Skip to content

Commit

Permalink
FIX: check properties of superclasses in is_fitted()
Browse files Browse the repository at this point in the history
  • Loading branch information
j-ittner committed Jul 11, 2023
1 parent 03fc727 commit 4ee81f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/facet/inspection/_learner_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,10 @@ def is_fitted(estimator: BaseEstimator) -> bool:
# get all properties of the estimator (instances of class ``property``)
fitted_properties = {
name
for name, value in vars(type(estimator)).items()
for cls in reversed(type(estimator).mro())
# traverse the class hierarchy in reverse order, so that we add the
# properties of the most specific class last
for name, value in vars(cls).items()
if (
# we're only interested in properties that scikit-learn
# sets when fitting a learner
Expand Down

0 comments on commit 4ee81f6

Please sign in to comment.