'''simple docstring'''
import numpy as np
from matplotlib import pyplot as plt
from sklearn.datasets import load_iris
from sklearn.metrics import ConfusionMatrixDisplay
from sklearn.model_selection import train_test_split
from xgboost import XGBClassifier







def  _UpperCamelCase (     _a	:	dict			):




    """simple docstring"""



    return (data["data"], data["target"])







def  _UpperCamelCase (     _a	:	np.ndarray				,     _a	:	np.ndarray			):




    """simple docstring"""



    __UpperCamelCase	:	List[str]		    =  XGBClassifier()
    classifier.fit(_a				,     _a			)
    return classifier







def  _UpperCamelCase (     ):




    """simple docstring"""



    __UpperCamelCase	:	Any		    =  load_iris()
    __UpperCamelCase    ,					__UpperCamelCase	:	int		    =  data_handling(_a			)
    __UpperCamelCase    ,					__UpperCamelCase    ,					__UpperCamelCase    ,					__UpperCamelCase	:	List[str]		    =  train_test_split(
        _a				,     _a				,     test_size=0.25			)

    __UpperCamelCase	:	Optional[int]		    =  iris['target_names']

    # Create an XGBoost Classifier from the training data
    __UpperCamelCase	:	Any		    =  xgboost(_a				,     _a			)

    # Display the confusion matrix of the classifier with both training and test sets
    ConfusionMatrixDisplay.from_estimator(
        _a				,     _a				,     _a				,     display_labels=_a				,     cmap='Blues'				,     normalize='true'				,     )
    plt.title('Normalized Confusion Matrix - IRIS Dataset'			)
    plt.show()


if __name__ == "__main__":
  import doctest

  doctest.testmod(verbose=True)
  main()




'''simple docstring'''
a=  '''0.21.0'''

from .accelerator import Accelerator
from .big_modeling import (
    cpu_offload,
    cpu_offload_with_hook,
    disk_offload,
    dispatch_model,
    init_empty_weights,
    init_on_device,
    load_checkpoint_and_dispatch,
)
from .data_loader import skip_first_batches
from .launchers import debug_launcher, notebook_launcher
from .state import PartialState
from .utils import (
    DeepSpeedPlugin,
    DistributedDataParallelKwargs,
    DistributedType,
    FullyShardedDataParallelPlugin,
    GradScalerKwargs,
    InitProcessGroupKwargs,
    find_executable_batch_size,
    infer_auto_device_map,
    is_rich_available,
    load_checkpoint_in_model,
    synchronize_rng_states,
)


if is_rich_available():
  from .utils import rich



