

'''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 	_lowerCAmelCase (						_UpperCamelCase						:					dict    )				->      tuple:
     """simple docstring"""




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


def 	_lowerCAmelCase (						_UpperCamelCase						:					np.ndarray							,			_UpperCamelCase						:					np.ndarray    )				->      XGBClassifier:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =XGBClassifier()
     classifier.fit(_UpperCamelCase							,			_UpperCamelCase    )
     return classifier


def 	_lowerCAmelCase (						)				->      None:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =load_iris()
     _SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE							   =data_handling(_UpperCamelCase    )
     _SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE							   =train_test_split(
         _UpperCamelCase							,			_UpperCamelCase							,			test_size=0.25    )

     _SCREAMING_SNAKE_CASE							   =iris['target_names']

     # Create an XGBoost Classifier from the training data
     _SCREAMING_SNAKE_CASE							   =xgboost(_UpperCamelCase							,			_UpperCamelCase    )

     # Display the confusion matrix of the classifier with both training and test sets
     ConfusionMatrixDisplay.from_estimator(
         _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			display_labels=_UpperCamelCase							,			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'''
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCamelCase			:				List[str] 			=					{"configuration_ibert": ["IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "IBertConfig", "IBertOnnxConfig"]}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCamelCase			:				Union[str, Any] 			=					[
         "IBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
         "IBertForMaskedLM",
         "IBertForMultipleChoice",
         "IBertForQuestionAnswering",
         "IBertForSequenceClassification",
         "IBertForTokenClassification",
         "IBertModel",
         "IBertPreTrainedModel",
     ]

if TYPE_CHECKING:
     from .configuration_ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig, IBertOnnxConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_ibert import (
              IBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
              IBertForMaskedLM,
              IBertForMultipleChoice,
              IBertForQuestionAnswering,
              IBertForSequenceClassification,
              IBertForTokenClassification,
              IBertModel,
              IBertPreTrainedModel,
          )

else:
     import sys

     lowerCamelCase			:				str 			=					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
