



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 				snake_case_(_UpperCamelCase					)							->     int:



  """simple docstring"""






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



def 				snake_case_(_UpperCamelCase			,	_UpperCamelCase					)							->     List[str]:



  """simple docstring"""






  _snake_case						=							XGBClassifier()
  classifier.fit(_A			,	_A					)
  return classifier



def 				snake_case_()							->     Tuple:



  """simple docstring"""






  _snake_case						=							load_iris()
  _snake_case						=							data_handling(_A					)
  _snake_case						=							train_test_split(
      _A			,	_A			,	test_size=0.25					)

  _snake_case						=							iris['target_names']

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




import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
 import ctypes
 import msvcrt  # noqa



 class   lowercase_   (  ctypes.Structure					):
       # _fields is a specific attr expected by ctypes
       UpperCamelCase_      :		List[Any]										=    [("size", ctypes.c_int), ("visible", ctypes.c_byte)]



def 				snake_case_()							->     int:



  """simple docstring"""






  if os.name == "nt":
    _snake_case						=							CursorInfo()
    _snake_case						=							ctypes.windll.kernelaa.GetStdHandle(-11					)
    ctypes.windll.kernelaa.GetConsoleCursorInfo(_UpperCamelCase			,	ctypes.byref(_UpperCamelCase					)					)
    _snake_case						=							False
    ctypes.windll.kernelaa.SetConsoleCursorInfo(_UpperCamelCase			,	ctypes.byref(_UpperCamelCase					)					)
  elif os.name == "posix":
    sys.stdout.write('''\033[?25l'''					)
    sys.stdout.flush()



def 				snake_case_()							->     Optional[Any]:



  """simple docstring"""






  if os.name == "nt":
    _snake_case						=							CursorInfo()
    _snake_case						=							ctypes.windll.kernelaa.GetStdHandle(-11					)
    ctypes.windll.kernelaa.GetConsoleCursorInfo(_UpperCamelCase			,	ctypes.byref(_UpperCamelCase					)					)
    _snake_case						=							True
    ctypes.windll.kernelaa.SetConsoleCursorInfo(_UpperCamelCase			,	ctypes.byref(_UpperCamelCase					)					)
  elif os.name == "posix":
    sys.stdout.write('''\033[?25h'''					)
    sys.stdout.flush()



@contextmanager
def 				snake_case_()							->     int:



  """simple docstring"""






  try:
    hide_cursor()
    yield
  finally:
    show_cursor()

