






from __future__ import annotations

def     snake_case   (UpperCAmelCase__      ,       UpperCAmelCase__      ,       UpperCAmelCase__      ,       UpperCAmelCase__    )			->							Optional[int]:  # noqa: E741
  while r - l > 1:
    UpperCamelCase_:   str        =							(l + r) // 2
    if v[m] >= key:
      UpperCamelCase_:   Any        =							m
    else:
      UpperCamelCase_:   int        =							m  # noqa: E741
  return r

def     snake_case   (UpperCAmelCase__    )			->							int:
  if len(UpperCAmelCase__    ) == 0:
    return 0

  UpperCamelCase_:   Optional[Any]        =							[0] * len(UpperCAmelCase__    )
  UpperCamelCase_:   Optional[int]        =							1

  UpperCamelCase_:   Any        =							v[0]

  for i in range(1      ,       len(UpperCAmelCase__    )    ):
    if v[i] < tail[0]:
      UpperCamelCase_:   Optional[int]        =							v[i]
    elif v[i] > tail[length - 1]:
      UpperCamelCase_:   Any        =							v[i]
      length += 1
    else:
      UpperCamelCase_:   Any        =							v[i]

  return length


if __name__ == "__main__":
   import doctest

   doctest.testmod()




"""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'''



			_lowerCamelCase					:					Dict	       =    XGBClassifier()
			classifier.fit(__a      ,							__a						)
			return classifier

def     UpperCAmelCase_					(				):




			'''simple docstring'''



			_lowerCamelCase					:					List[str]	       =    load_iris()
			_lowerCamelCase       ,							_lowerCamelCase					:					Optional[Any]	       =    data_handling(__a						)
			_lowerCamelCase       ,							_lowerCamelCase       ,							_lowerCamelCase       ,							_lowerCamelCase					:					int	       =    train_test_split(
			    __a      ,							__a      ,							test_size=0.2_5						)

			_lowerCamelCase					:					Optional[Any]	       =    iris['target_names']

			# Create an XGBoost Classifier from the training data
			_lowerCamelCase					:					Tuple	       =    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()





