ó
    Ñ]j'"  ã                   ó`   • S r SSKrSSKrSSKJr  SSKJr  SSKJr  1 Skr	SS jr
S rS	 rS
 rg)z+Utilities to discover scikit-learn objects.é    N)Úimport_module)Ú
itemgetter)ÚPath>   ÚsetupÚtestsÚconftestÚ	externalsÚexperimentalÚestimator_checksc           
      óæ  • SSK JnJnJnJnJn  SSKJn  S n/ n[        [        [        5      R                  R                  5      n	U" [        S9   [        R                  " U	/SS9 H¨  u  p«n
UR                  S5      n[!        S	 U 5       5      (       d  S
U;   a  M6  [#        U5      n[$        R&                  " U[$        R(                  5      nU VVs/ s H"  u  nnUR+                  S5      (       a  M  UU4PM$     nnnUR-                  U5        Mª     SSS5        [/        U5      nU Vs/ s H&  n[1        US   U5      (       d  M  US   S:w  d  M$  UPM(     nnU Vs/ s H  nU" US   5      (       a  M  UPM     nnU b°  [3        U [4        5      (       d  U /n O[5        U 5      n / nUUUUS.nUR7                  5        HV  u  nnXð;   d  M  U R9                  U5        UR-                  U Vs/ s H  n[1        US   U5      (       d  M  UPM     sn5        MX     UnU (       a  [;        SU < S35      e[=        [/        U5      [?        S5      S9$ s  snnf ! , (       d  f       GNF= fs  snf s  snf s  snf )a�  Get 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)
<class 'list'>
>>> type(estimators[0])
<class 'tuple'>
>>> estimators[:2]
[('ARDRegression', <class 'sklearn.linear_model._bayes.ARDRegression'>),
 ('AdaBoostClassifier',
  <class 'sklearn.ensemble._weight_boosting.AdaBoostClassifier'>)]
>>> classifiers = all_estimators(type_filter="classifier")
>>> classifiers[:2]
[('AdaBoostClassifier',
  <class 'sklearn.ensemble._weight_boosting.AdaBoostClassifier'>),
 ('BaggingClassifier', <class 'sklearn.ensemble._bagging.BaggingClassifier'>)]
>>> regressors = all_estimators(type_filter="regressor")
>>> regressors[:2]
[('ARDRegression', <class 'sklearn.linear_model._bayes.ARDRegression'>),
 ('AdaBoostRegressor',
  <class 'sklearn.ensemble._weight_boosting.AdaBoostRegressor'>)]
>>> both = all_estimators(type_filter=["classifier", "regressor"])
>>> both[:2]
[('ARDRegression', <class 'sklearn.linear_model._bayes.ARDRegression'>),
 ('AdaBoostClassifier',
  <class 'sklearn.ensemble._weight_boosting.AdaBoostClassifier'>)]
r   )ÚBaseEstimatorÚClassifierMixinÚClusterMixinÚRegressorMixinÚTransformerMixin©Úignore_warningsc                 ó^   • [        U S5      (       d  g[        U R                  5      (       d  gg)NÚ__abstractmethods__FT)ÚhasattrÚlenr   )Úcs    ÚT/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sklearn/utils/discovery.pyÚis_abstractÚ#all_estimators.<locals>.is_abstractS   s*   € Ü˜Ð0×1Ñ1ØÜ�1×(Ñ(×)Ñ)ØØó    ©Úcategoryúsklearn.©ÚpathÚprefixÚ.c              3   ó2   #   • U  H  o[         ;   v •  M     g 7f©N©Ú_MODULE_TO_IGNORE©Ú.0Úparts     r   Ú	<genexpr>Ú!all_estimators.<locals>.<genexpr>b   ó   é € ÐGº,°$Ô-Ö-º,ùó   ‚ú._Ú_Né   r   )Ú
classifierÚ	regressorÚtransformerÚclusterz_Parameter type_filter must be 'classifier', 'regressor', 'transformer', 'cluster' or None, got ©Úkey) Úsklearn.baser   r   r   r   r   Úsklearn.utils._testingr   Ústrr   Ú__file__ÚparentÚFutureWarningÚpkgutilÚwalk_packagesÚsplitÚanyr   ÚinspectÚ
getmembersÚisclassÚ
startswithÚextendÚsetÚ
issubclassÚ
isinstanceÚlistÚitemsÚremoveÚ
ValueErrorÚsortedr   )Útype_filterr   r   r   r   r   r   r   Úall_classesÚrootr0   Úmodule_nameÚmodule_partsÚmoduleÚclassesÚnameÚest_clsr   Ú
estimatorsÚfiltered_estimatorsÚfiltersÚmixinÚests                          r   Úall_estimatorsr]      sV  € ÷hõ õ 7òð €KÜŒt”H‹~×$Ñ$×+Ñ+Ó,€Dñ 
¤-Ó	0Ü!(×!6Ò!6¸T¸FÈ:Ô!VÑˆA˜AØ&×,Ñ,¨SÓ1ˆLäÑG¹,ÓG×GÑGØ˜;Ó&áÜ" ;Ó/ˆFÜ×(Ò(¨´·±ÓAˆGá5<ôÚ5<¡M D¨'ÀDÇOÁOÐTW×DX“��w“±Wð ñ ð ×Ñ˜wÖ'ñ "W÷ 
1ô  �kÓ"€Kñ óâˆAÜ�q˜‘t˜]×+ó 	
à01°!±¸Ñ0G÷ 	
Ùð ð ñ (ÓAšZ˜©{¸1¸Q¹4×/@—!™Z€JÐAàÑÜ˜+¤t×,Ñ,Ø&˜-‰Kä˜{Ó+ˆKØ Ðà)Ø'Ø+Ø#ñ	
ˆð #Ÿ=™=ž?‰KˆD�%ØÕ"Ø×"Ñ" 4Ô(Ø#×*Ñ*Ù$.ÓL¢J˜S´*¸SÀ¹VÀU×2K—S¡JÑLöñ +ð )ˆ
ÞÜðð  ‘? !ð%óð ô ”#�j“/¤z°!£}Ñ5Ð5ùó]÷ 
1Ö	0üò$ùò Bùò$ MsO   ÁBIÃI
Ã3I
Ã;IÄ*I$ÅI$ÅI$ÅI)Å5I)Ç*I.
ÈI.
ÉIÉ
I!c            	      ó¦  • SSK Jn   / n[        [        [        5      R
                  R
                  5      nU " [        S9   [        R                  " U/SS9 H¾  u  p4nUR                  S5      n[        S U 5       5      (       d  SU;   a  M6  [        U5      n[        R                  " U[        R                  5      nU VV	s/ s H8  u  p‰UR                  S	5      (       a  M  UR!                  S
5      (       d  M5  X‰4PM:     nnn	UR#                  U5        MÀ     SSS5        [%        ['        U5      [)        S5      S9$ s  sn	nf ! , (       d  f       N0= f)a–  Get a list of all displays from `sklearn`.

Returns
-------
displays : list of tuples
    List of (name, class), where ``name`` is the display class name as
    string and ``class`` is the actual type of the class.

Examples
--------
>>> from sklearn.utils.discovery import all_displays
>>> displays = all_displays()
>>> displays[0]
('CalibrationDisplay', <class 'sklearn.calibration.CalibrationDisplay'>)
r   r   r   r   r    r#   c              3   ó2   #   • U  H  o[         ;   v •  M     g 7fr%   r&   r(   s     r   r+   Úall_displays.<locals>.<genexpr>´   r-   r.   r/   r0   ÚDisplayNr6   )r9   r   r:   r   r;   r<   r=   r>   r?   r@   rA   r   rB   rC   rD   rE   ÚendswithrF   rN   rG   r   )
r   rP   rQ   r0   rR   rS   rT   rU   rV   Údisplay_classs
             r   Úall_displaysrd   ™   s  € õ" 7à€KÜŒt”H‹~×$Ñ$×+Ñ+Ó,€Dñ 
¤-Ó	0Ü!(×!6Ò!6¸T¸FÈ:Ô!VÑˆA˜AØ&×,Ñ,¨SÓ1ˆLäÑG¹,ÓG×GÑGØ˜;Ó&áÜ" ;Ó/ˆFÜ×(Ò(¨´·±ÓAˆGñ ,3ôâ+2Ñ'�DØ—‘ s×+ó &à04·±¸i×0Hó &�Ó%Ù+2ð ñ ð
 ×Ñ˜wÖ'ñ "W÷ 
1ô" ”#�kÓ"¬
°1«Ñ6Ð6ùó÷ 
1Õ	0ús*   ¿BEÃD<
Ã!D<
Ã9D<
Ä EÄ<EÅ
Ec                 óð   • [         R                  " U 5      (       d  gU R                  R                  S5      (       a  gU R                  nUR                  S5      (       a  UR                  S5      (       a  gg)NFr0   r   r   T)rB   Ú
isfunctionÚ__name__rE   Ú
__module__rb   )ÚitemÚmods     r   Ú_is_checked_functionrk   Ä   s[   € Ü×Ò˜d×#Ñ#Øà‡}�}×Ñ ×$Ñ$Øà
�/‰/€CØ�>‰>˜*×%Ñ%¨¯©Ð6H×)IÑ)IØàr   c            	      óx  • SSK Jn   / n[        [        [        5      R
                  R
                  5      nU " [        S9   [        R                  " U/SS9 H§  u  p4nUR                  S5      n[        S U 5       5      (       d  SU;   a  M6  [        U5      n[        R                  " U[        5      nU VV	s/ s H+  u  p‰UR                  S	5      (       a  M  U	R                   U	4PM-     nnn	UR#                  U5        M©     S
S
S
5        [%        ['        U5      [)        S5      S9$ s  sn	nf ! , (       d  f       N0= f)av  Get 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'
r   r   r   r   r    r#   c              3   ó2   #   • U  H  o[         ;   v •  M     g 7fr%   r&   r(   s     r   r+   Ú all_functions.<locals>.<genexpr>î   r-   r.   r/   r0   Nr6   )r9   r   r:   r   r;   r<   r=   r>   r?   r@   rA   r   rB   rC   rk   rE   rg   rF   rN   rG   r   )
r   Úall_functionsrQ   r0   rR   rS   rT   Ú	functionsrV   Úfuncs
             r   ro   ro   Ò   s  € õ$ 7à€MÜŒt”H‹~×$Ñ$×+Ñ+Ó,€Dñ 
¤-Ó	0Ü!(×!6Ò!6¸T¸FÈ:Ô!VÑˆA˜AØ&×,Ñ,¨SÓ1ˆLäÑG¹,ÓG×GÑGØ˜;Ó&áä" ;Ó/ˆFÜ×*Ò*¨6Ô3GÓHˆIñ #,ôâ"+‘J�DØ—‘ s×+ó &�—‘ Ó%Ù"+ð ñ ð
 × Ñ  Ö+ñ "W÷ 
1ô* ”#�mÓ$¬*°Q«-Ñ8Ð8ùó÷ 
1Õ	0ús$   ¿A8D+Â7D%
ÃD%
Ã)D+Ä%D+Ä+
D9r%   )Ú__doc__rB   r>   Ú	importlibr   Úoperatorr   Úpathlibr   r'   r]   rd   rk   ro   © r   r   Ú<module>rw      s8   ðÙ 1ó
 Û Ý #Ý Ý òÐ ô@6òF(7òVó-9r   