o
    Ú­ju  ã                   @   s:   d Z ddlmZmZ ddlmZmZ eG dd„ dƒƒZdS )z/Xgboost training summary integration submodule.é    )Ú	dataclassÚfield)ÚDictÚListc                   @   sx   e Zd ZU dZeed�Zeee	e
 f ed< eed�Zeee	e
 f ed< edeeeee	e
 f f dd fdd„ƒZd	S )
ÚXGBoostTrainingSummaryz
    A class that holds the training and validation objective history
    of an XGBoost model during its training process.
    )Údefault_factoryÚtrain_objective_historyÚvalidation_objective_historyÚmetricsÚreturnc                 C   s"   |   di ¡}|   di ¡}t||ƒS )a  
        Create an XGBoostTrainingSummary instance from a nested dictionary of metrics.

        Parameters
        ----------
        metrics : dict of str to dict of str to list of float
            A dictionary containing training and validation metrics.
            Example format:
                {
                    "training": {"logloss": [0.1, 0.08]},
                    "validation": {"logloss": [0.12, 0.1]}
                }

        Returns
        -------
        A new instance of XGBoostTrainingSummary.

        ÚtrainingÚ
validation)Úgetr   )r
   r   r	   © r   úR/var/www/html/CropPilot/venv/lib/python3.10/site-packages/xgboost/spark/summary.pyÚfrom_metrics   s
   ÿz#XGBoostTrainingSummary.from_metricsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Údictr   r   Ústrr   ÚfloatÚ__annotations__r	   Ústaticmethodr   r   r   r   r   r      s   
 ÿþr   N)r   Údataclassesr   r   Útypingr   r   r   r   r   r   r   Ú<module>   s
    