File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 99import numpy as np
1010from sklearn .base import BaseEstimator , OneToOneFeatureMixin
1111from sklearn .preprocessing import label_binarize
12- from sklearn .utils ._metadata_requests import METHODS , SIMPLE_METHODS
12+ from sklearn .utils ._metadata_requests import METHODS
1313from sklearn .utils .multiclass import check_classification_targets
1414
1515from .utils import check_sampling_strategy , check_target_type
2121if "fit_transform" not in METHODS :
2222 METHODS .append ("fit_transform" )
2323METHODS .append ("fit_resample" )
24- SIMPLE_METHODS .append ("fit_resample" )
24+
25+ try :
26+ from sklearn .utils ._metadata_requests import SIMPLE_METHODS
27+
28+ SIMPLE_METHODS .append ("fit_resample" )
29+ except ImportError :
30+ # in older versions of scikit-learn, only METHODS is used
31+ pass
2532
2633
2734class SamplerMixin (metaclass = ABCMeta ):
You can’t perform that action at this time.
0 commit comments