o
    Ú­jd  ã                   @   s�   d Z ddlmZ ddlmZ ddlmZmZ G dd„ deƒZG dd„ deƒZ	G d	d
„ d
eƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZdS )z1Xgboost pyspark integration submodule for params.é    )ÚDict)ÚTypeConverters)ÚParamÚParamsc                   @   s*   e Zd ZU dZee ¡ ddƒZded< dS )ÚHasArbitraryParamsDictz›
    This is a Params based class that is extended by _SparkXGBParams
    and holds the variable to store the **kwargs parts of the XGBoost
    input.
    Úarbitrary_params_dictzÚarbitrary_params_dict This parameter holds all of the additional parameters which are not exposed as the XGBoost Spark estimator params but can be recognized by underlying XGBoost library. It is stored as a dictionary.zParam[Dict]N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú_dummyr   Ú__annotations__© r   r   úQ/var/www/html/CropPilot/venv/lib/python3.10/site-packages/xgboost/spark/params.pyr   	   s   
 ýr   c                   @   ó&   e Zd ZdZee ¡ ddejd�Z	dS )ÚHasBaseMarginColz–
    This is a Params based class that is extended by _SparkXGBParams
    and holds the variable to store the base margin column part of XGboost.
    Úbase_margin_colz6This stores the name for the column of the base margin©ÚtypeConverterN)
r   r	   r
   r   r   r   r   r   ÚtoStringr   r   r   r   r   r      s    
ür   c                       ó8   e Zd ZdZee ¡ ddejd�Z	d	‡ fdd„Z
‡  ZS )
ÚHasFeaturesColsz…
    Mixin for param features_cols: a list of feature column names.
    This parameter is taken effect only when GPU is enabled.
    Úfeatures_colszfeature column names.r   ÚreturnNc                    s   t ƒ  ¡  | jg d� d S )N)r   ©ÚsuperÚ__init__Ú_setDefault©Úself©Ú	__class__r   r   r   4   ó   
zHasFeaturesCols.__init__©r   N)r   r	   r
   r   r   r   r   r   ÚtoListStringr   r   Ú__classcell__r   r   r    r   r   '   s    ür   c                       r   )
ÚHasEnableSparseDataOptimz§
    This is a Params based class that is extended by _SparkXGBParams
    and holds the variable to store the boolean config of enabling sparse data optimization.
    Úenable_sparse_data_optima4  This stores the boolean config of enabling sparse data optimization, if enabled, Xgboost DMatrix object will be constructed from sparse matrix instead of dense matrix. This config is disabled by default. If most of examples in your training dataset contains sparse features, we suggest to enable this config.r   r   Nc                    s   t ƒ  ¡  | jdd� d S )NF)r'   r   r   r    r   r   r   I   r"   z!HasEnableSparseDataOptim.__init__r#   )r   r	   r
   r   r   r   r   r   Ú	toBooleanr'   r   r%   r   r   r    r   r&   9   s    ù
r&   c                   @   r   )ÚHasQueryIdColz8
    Mixin for param qid_col: query id column name.
    Úqid_colzquery id column namer   N)
r   r	   r
   r   r   r   r   r   r   r*   r   r   r   r   r)   N   s    
ür)   c                   @   s0   e Zd ZU dZee ¡ ddejd�Z	de
d< dS )ÚHasContribPredictionColzß
    Mixin for param pred_contrib_col: contribution prediction column name.

    Output is a 3-dim array, with (rows, groups, columns + 1) for classification case.
    Else, it can be a 2 dimension for regression case.
    Úpred_contrib_colz0feature contributions to individual predictions.r   z
Param[str]N)r   r	   r
   r   r   r   r   r   r   r,   r   r   r   r   r   r+   [   s   
 ür+   N)r   Útypingr   Úpyspark.ml.paramr   Úpyspark.ml.param.sharedr   r   r   r   r   r&   r)   r+   r   r   r   r   Ú<module>   s    