Conditions | 2 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # Author: Simon Blanke |
||
27 | def _estimator_has(attr): |
||
28 | def check(self): |
||
29 | _check_refit(self, attr) |
||
30 | if hasattr(self, "best_estimator_"): |
||
31 | # raise an AttributeError if `attr` does not exist |
||
32 | getattr(self.best_estimator_, attr) |
||
33 | return True |
||
34 | # raise an AttributeError if `attr` does not exist |
||
35 | getattr(self.estimator, attr) |
||
36 | return True |
||
37 | |||
38 | return check |
||
39 |