File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 13
13
from scipy .stats .mstats import mquantiles
14
14
15
15
from ..base import is_classifier , is_regressor
16
- from ..pipeline import Pipeline
17
16
from ..utils .extmath import cartesian
18
17
from ..utils import check_array
19
18
from ..utils import check_matplotlib_support # noqa
@@ -383,20 +382,11 @@ def partial_dependence(
383
382
... grid_resolution=2) # doctest: +SKIP
384
383
(array([[-4.52..., 4.52...]]), [array([ 0., 1.])])
385
384
"""
385
+ check_is_fitted (estimator )
386
+
386
387
if not (is_classifier (estimator ) or is_regressor (estimator )):
387
388
raise ValueError ("'estimator' must be a fitted regressor or classifier." )
388
389
389
- if isinstance (estimator , Pipeline ):
390
- # TODO: to be removed if/when pipeline get a `steps_` attributes
391
- # assuming Pipeline is the only estimator that does not store a new
392
- # attribute
393
- for est in estimator :
394
- # FIXME: remove the None option when it will be deprecated
395
- if est not in (None , "drop" ):
396
- check_is_fitted (est )
397
- else :
398
- check_is_fitted (estimator )
399
-
400
390
if is_classifier (estimator ) and isinstance (estimator .classes_ [0 ], np .ndarray ):
401
391
raise ValueError ("Multiclass-multioutput estimators are not supported" )
402
392
You can’t perform that action at this time.
0 commit comments