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     _a				(      lowercase__  :			dict ):







     '''simple docstring'''


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







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







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				Union[str, Any]			=		XGBClassifier()
     classifier.fit(lowercase__     ,  lowercase__ )
     return classifier







def     _a				(      ):







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				Dict			=		load_iris()
     SCREAMING_SNAKE_CASE__			,							SCREAMING_SNAKE_CASE__				:				Optional[int]			=		data_handling(lowercase__ )
     SCREAMING_SNAKE_CASE__			,							SCREAMING_SNAKE_CASE__			,							SCREAMING_SNAKE_CASE__			,							SCREAMING_SNAKE_CASE__				:				List[str]			=		train_test_split(
         lowercase__     ,  lowercase__     ,  test_size=0.25 )

     SCREAMING_SNAKE_CASE__				:				Tuple			=		iris['target_names']

     # Create an XGBoost Classifier from the training data
     SCREAMING_SNAKE_CASE__				:				Tuple			=		xgboost(lowercase__     ,  lowercase__ )

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


if __name__ == "__main__":
      import doctest

      doctest.testmod(verbose=True)
      main()




from __future__ import annotations







def     _a				(      lowercase__  :			list[int | float]     ,  lowercase__  :			int     ,  lowercase__  :			int ):







     '''simple docstring'''


     if len(lowercase__ ) == 0:
          raise ValueError('find_max() arg is an empty sequence' )
     if (
         left >= len(lowercase__ )
         or left < -len(lowercase__ )
         or right >= len(lowercase__ )
         or right < -len(lowercase__ )
     ):
          raise IndexError('list index out of range' )
     if left == right:
          return nums[left]
     SCREAMING_SNAKE_CASE__				:				Union[str, Any]			=		(left + right) >> 1  # the middle
     SCREAMING_SNAKE_CASE__				:				int			=		find_max(lowercase__     ,  lowercase__     ,  lowercase__ )  # find max in range[left, mid]
     SCREAMING_SNAKE_CASE__				:				Tuple			=		find_max(lowercase__     ,  mid + 1     ,  lowercase__ )  # find max in range[mid + 1, right]

     return left_max if left_max >= right_max else right_max


if __name__ == "__main__":
      import doctest

      doctest.testmod(verbose=True)



