


from __future__ import annotations
def     __lowerCamelCase						(			UpperCAmelCase_						:		list[int | float]			,  UpperCAmelCase_						:		int			,  UpperCAmelCase_						:		int						):




      """simple docstring"""





      if len(_lowerCAmelCase						) == 0:
            raise ValueError('''find_max() arg is an empty sequence'''						)
      if (
          left >= len(_lowerCAmelCase						)
          or left < -len(_lowerCAmelCase						)
          or right >= len(_lowerCAmelCase						)
          or right < -len(_lowerCAmelCase						)
      ):
            raise IndexError('''list index out of range'''						)
      if left == right:
            return nums[left]
      a						:Any										=	(left + right) >> 1  # the middle
      a						:Any										=	find_max(_lowerCAmelCase			,  _lowerCAmelCase			,  _lowerCAmelCase						)  # find max in range[left, mid]
      a						:str										=	find_max(_lowerCAmelCase			,  mid + 1			,  _lowerCAmelCase						)  # 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)









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						):




      """simple docstring"""





      return (data["data"], data["target"])
def     __lowerCamelCase						(			UpperCAmelCase_						:		np.ndarray			,  UpperCAmelCase_						:		np.ndarray						):




      """simple docstring"""





      a						:Optional[Any]										=	XGBClassifier()
      classifier.fit(UpperCAmelCase_			,  UpperCAmelCase_						)
      return classifier
def     __lowerCamelCase						(			):




      """simple docstring"""





      a						:List[Any]										=	load_iris()
      a							,    a						:Any										=	data_handling(UpperCAmelCase_						)
      a							,    a							,    a							,    a						:Tuple										=	train_test_split(
          UpperCAmelCase_			,  UpperCAmelCase_			,  test_size=0.25						)

      a						:List[Any]										=	iris['''target_names''']

      # Create an XGBoost Classifier from the training data
      a						:Optional[int]										=	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()





