
    Pi                     *    d Z ddlmZ ddlmZ ddZdS )z&This module contains utility routines.    )is_classifier)
_BinMapperlightgbmNc                    |dvr"t          d                    |                    |                                 }|d         dk    rt          d          |d         rt          d          dd	|d
k    rdndddd}i d||d                  d|d         d|d         d|d         d|d         d|d         d|d         d|d         dddd d!d"d#|d$         rd%nd&d'd(d)d*d+t	                      j        d,d-d.|d/         }|d         d0k    r.|d
k    r(|dxx         d
z  cc<   ||dxx         ||dz
  z  z  cc<   d2d3|d
k    rd4nd5d6d7d}d8d9||d                  |d         |d         |d         |d         pd"|d         |d         d |d$         rd
nd"|d$         d"k    d:|d/         d;}d<d=|d
k    rd>nd?d1d@d}||d                  |d         |d         |d         |d         |d         dAdBt          |d$                   dC	}	|dDk    r'd"dElm}
m	} t          |           r |
dIi |S  |dIi |S |dFk    r'd"dGlm}m} t          |           r |dIi |S  |dIi |S d"dHlm}m} t          |           r |dIi |	S  |dIi |	S )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_*
    )r   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_bin   min_sum_hessian_in_leafgMbP?min_split_gainr   	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   rH   rI   r   r   rJ   rK   r   rL   rM   )	estimatorlib	n_classessklearn_paramslightgbm_loss_mappinglightgbm_paramsxgboost_loss_mappingxgboost_paramscatboost_loss_mappingcatboost_paramsrH   rI   rJ   rK   rL   rM   s                   /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/sklearn/ensemble/_hist_gradient_boosting/utils.pyget_equivalent_estimatorr`   
   s     555HOOPSTT
 
 	
 ))++Nf''B
 
 	
 &' K!"IJJJ )) )QHHL *>&+AB8 	z2 	n%56	
 	^K0 	N+=> 	n%89 	>*- 	1 	"4 	! 	>)4=RR# 	d 	 	Z\\3  	!%!" 	">.#A#O( f++	A1222a7222
  O,,,	Y]0KK,,, &<&/1nnNN/"  ").*@A'8&z2$%56#K05A !45!*- (3:QQ +q0*>: N&  <!*aII\  /~f/EF'8$Z0,$%89!*-'"*y122
 
O j::::::::## 	4!>44O444 =33?333				77777777## 	2 =22>222<11.111 	CBBBBBBB## 	8%%88888$$77777    )r   N)__doc__sklearn.baser   0sklearn.ensemble._hist_gradient_boosting.binningr   r`   rN   ra   r_   <module>re      sU    , ,
 ' & & & & & G G G G G GK8 K8 K8 K8 K8 K8ra   