`L i!^dZddlZddlZddlmZddlmZddlmZhdZ d dZ dZ d Z d Z y) z+Utilities to discover scikit-learn objects.N) import_module) itemgetter)Path>setuptestsconftest externals experimentalestimator_checksc jddlm}m}m}m}m}ddlm}d}g}tttjj} |t5tj| gdD]\} } } | jd } t!d | Dsd | vr/t#| } t%j&| t$j(}|Dcgc]\}}|j+d r||f}}}|j-| d d d t/|}|Dcgc]}t1|d|r |ddk7r|}}|Dcgc]}||dr|}}|t3|t4s|g}n t5|}g}||||d}|j7D]J\}}||vs |j9||j-|Dcgc]}t1|d|s|c}L|}|rt;d|d t=t/|t?dScc}}w#1swYxYwcc}wcc}wcc}w)a1Get a list of all estimators from `sklearn`. This function crawls the module and gets all classes that inherit from BaseEstimator. Classes that are defined in test-modules are not included. Parameters ---------- type_filter : {"classifier", "regressor", "cluster", "transformer"} or list of such str, default=None Which kind of estimators should be returned. If None, no filter is applied and all estimators are returned. Possible values are 'classifier', 'regressor', 'cluster' and 'transformer' to get estimators only of these specific types, or a list of these to get the estimators that fit at least one of the types. Returns ------- estimators : list of tuples List of (name, class), where ``name`` is the class name as string and ``class`` is the actual type of the class. Examples -------- >>> from sklearn.utils.discovery import all_estimators >>> estimators = all_estimators() >>> type(estimators) >>> type(estimators[0]) >>> estimators[:2] [('ARDRegression', ), ('AdaBoostClassifier', )] >>> classifiers = all_estimators(type_filter="classifier") >>> classifiers[:2] [('AdaBoostClassifier', ), ('BaggingClassifier', )] >>> regressors = all_estimators(type_filter="regressor") >>> regressors[:2] [('ARDRegression', ), ('AdaBoostRegressor', )] >>> both = all_estimators(type_filter=["classifier", "regressor"]) >>> both[:2] [('ARDRegression', ), ('AdaBoostClassifier', )] ) BaseEstimatorClassifierMixin ClusterMixinRegressorMixinTransformerMixinignore_warningscJt|dsyt|jsyy)N__abstractmethods__FT)hasattrlenr)cs ]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sklearn/utils/discovery.py is_abstractz#all_estimators..is_abstractSs$011(()categorysklearn.pathprefix.c3,K|] }|tvywN_MODULE_TO_IGNORE.0parts r z!all_estimators..bG$D--G.__Nrr) classifier regressor transformerclusterz_Parameter type_filter must be 'classifier', 'regressor', 'transformer', 'cluster' or None, got key) baserrrrr_testingrstrr__file__parent FutureWarningpkgutil walk_packagessplitanyrinspect getmembersisclass startswithextendset issubclass isinstancelistitemsremove ValueErrorsortedr) type_filterrrrrrrr all_classesrootr0 module_name module_partsmoduleclassesnameest_clsr estimatorsfiltered_estimatorsfiltersmixinests rall_estimatorsr\sRh*K tH~$$++ ,D - 0(!(!6!6TF:!V ( A{A&,,S1LG,GG;&";/F((AG5<$1D'DOOTWDXwG   w ' (( k"K qt] +!0G J (A{1Q4/@!AJA+t,&-K{+K )'+#   #==? KD%{"""4(#**$.LS*SVU2KSL  )  ?!%  #j/z!} 55](($ B$MsCA>> from sklearn.utils.discovery import all_displays >>> displays = all_displays() >>> displays[0] ('CalibrationDisplay', ) rrrr r!r$c3,K|] }|tvywr&r'r)s rr,zall_displays..r-r.r/r0DisplayNrr5)r8rr9rr:r;r<r=r>r?r@rrArBrCrDendswithrErMrFr) rrOrPr0rQrRrSrTrU display_classs r all_displaysrbs"*K tH~$$++ ,D - 0(!(!6!6TF:!V ( A{A&,,S1LG,GG;&";/F((AG,3'D-s+ i0H}%G   w ' ((" #k" 1 66((sA0D, .D2,D22D;ctj|sy|jjdry|j}|jdr|j dryy)NFr0r r T)rA isfunction__name__rD __module__r`)itemmods r_is_checked_functionrisO   d # }}$ //C >>* %6H)I rc Zddlm}g}tttj j }|t 5tj|gdD]\}}}|jd}td|Dsd|vr/t|}tj|t}|D cgc]$\}} |jd s| j | f&}}} |j#| d d d t%t'|t)d  Scc} }w#1swY.xYw) aGet a list of all functions from `sklearn`. Returns ------- functions : list of tuples List of (name, function), where ``name`` is the function name as string and ``function`` is the actual function. Examples -------- >>> from sklearn.utils.discovery import all_functions >>> functions = all_functions() >>> name, function = functions[0] >>> name 'accuracy_score' rrrr r!r$c3,K|] }|tvywr&r'r)s rr,z all_functions..r-r.r/r0Nrr5)r8rr9rr:r;r<r=r>r?r@rrArBrirDrerErMrFr) r all_functionsrPr0rQrRrS functionsrUfuncs rrlrls$*M tH~$$++ ,D - 0,!(!6!6TF:!V , A{A&,,S1LG,GG;&";/F**63GHI#,D$s+%I   + ,,* #m$*Q- 88,,sA2D!4)D D!D!!D*r&)__doc__rAr= importlibroperatorrpathlibrr(r\rbrirlrrrts81 #@6F(7V -9r