
    -i                     *    S r SSKJr  SSKJr  SS jrg)z&This module contains utility routines.   )is_classifier   )
_BinMapperNc                 B   US;  a  [        SR                  U5      5      eU R                  5       nUS   S:X  a  [        S5      eUS   (       a  [        S5      eSS	US
:X  a  SOSSSS.n0 SXCS      _SUS   _SUS   _SUS   _SUS   _SUS   _SUS   _SUS   _SS_SS _S!S"_S#US$   (       a  S%OS&_S'S(_S)S*_S+[	        5       R
                  _S,S-_S.US/   _nUS   S0:X  a(  US
:  a"  US==   S
-  ss'   Ub  US==   X"S-
  -  -  ss'   S2S3US
:X  a  S4OS5S6S7S.nS8S9XcS      US   US   US   US   =(       d    S"US   US   S US$   (       a  S
OS"US$   S":H  S:US/   S;.nS<S=US
:X  a  S>OS?S1S@S.nXS      US   US   US   US   US   SASB[        US$   5      SC.	n	USD:X  a(  S"SEKJn
J	n  [        U 5      (       a  U
" SI0 UD6$ U" SI0 UD6$ USF:X  a(  S"SGKJnJn  [        U 5      (       a  U" SI0 UD6$ U" SI0 UD6$ S"SHKJnJn  [        U 5      (       a  U" SI0 U	D6$ U" SI0 U	D6$ )Ja~  Return an unfitted estimator from another lib with matching hyperparams.

This utility function takes care of renaming the sklearn parameters into
their LightGBM, XGBoost or CatBoost equivalent parameters.

# unmapped XGB parameters:
# - min_samples_leaf
# - min_data_in_bin
# - min_split_gain (there is min_split_loss though?)

# unmapped Catboost parameters:
# max_leaves
# min_*
)lightgbmxgboostcatboostz:accepted libs are lightgbm, xgboost, and catboost.  got {}lossautozaauto loss is not accepted. We need to know if the problem is binary or multiclass classification.early_stoppingz%Early stopping should be deactivated.regression_l2regression_l1   binary
multiclassgammapoisson)squared_errorabsolute_errorlog_lossr   r   	objectivelearning_raten_estimatorsmax_iter
num_leavesmax_leaf_nodes	max_depthmin_data_in_leafmin_samples_leaf
reg_lambdal2_regularizationmax_binmax_binsmin_data_in_binr   min_sum_hessian_in_leafgMbP?min_split_gain    	verbosityverbose
   iboost_from_averageTenable_bundleFsubsample_for_binpoisson_max_delta_stepg-q=feature_fraction_bynodemax_featuresr   Nz
reg:linear LEAST_ABSOLUTE_DEV_NOT_SUPPORTEDzreg:logisticzmulti:softmaxz	reg:gammazcount:poissonhist	lossguide)tree_methodgrow_policyr   r   r   
max_leavesr   lambdar"   min_child_weightr(   silentn_jobscolsample_bynodeRMSE LEAST_ASBOLUTE_DEV_NOT_SUPPORTEDLogloss
MultiClassPoissonMedianNewton)	loss_functionr   
iterationsdepthr    r"   feature_border_typeleaf_estimation_methodr)   r   )LGBMClassifierLGBMRegressorr   )XGBClassifierXGBRegressor)CatBoostClassifierCatBoostRegressor )
ValueErrorformat
get_paramsNotImplementedErrorr   	subsampleboolr   rI   rJ   r   r   rK   rL   r	   rM   rN   )	estimatorlib	n_classessklearn_paramslightgbm_loss_mappinglightgbm_paramsxgboost_loss_mappingxgboost_paramscatboost_loss_mappingcatboost_paramsrI   rJ   rK   rL   rM   rN   s                   a/var/www/html/venv/lib/python3.13/site-packages/sklearn/ensemble/_hist_gradient_boosting/utils.pyget_equivalent_estimatorra   
   s     55HOOPST
 	
 ))+Nf'B
 	
 &'!"IJJ )) )QHL*&+AB8 	z2 	n%56	
 	^K0 	N+=> 	n%89 	>*- 	1 	"4 	! 	>)4R# 	d 	 	Z\33  	!%!" 	">.#A#O( f+	A12a72
  O,	]0KK, &<&/1nN/" ")*@A'8&z2$%56#K05A !45!*- (3Q +q0*>:N&  <!*aI\ /f/EF'8$Z0,$%89!*-'"*y12
O j:##!4O44 3?33			7## 2>221.11 	C##%888$777    )r   N)__doc__baser   binningr   ra   rO   rb   r`   <module>rf      s    ,
 " K8rb   