


'''simple docstring'''

import enum
import shutil
import sys


a_			,     a_						:       List[str]      			=				shutil.get_terminal_size()

a_						:       Optional[Any]      			=				{"""UP""": """A""", """DOWN""": """B""", """RIGHT""": """C""", """LEFT""": """D"""}





class   snake_case					(					enum.Enum    ):





		"""simple docstring"""




		_lowerCamelCase						=						0
		_lowerCamelCase						=						1





def __snake_case      (   UpperCAmelCase_		:		Optional[Any]      ,       UpperCAmelCase_		:		Optional[int]=""	):
	sys.stdout.write(str(__A	) + end	)
	sys.stdout.flush()





def __snake_case      (   UpperCAmelCase_		:		Union[str, Any]      ,       UpperCAmelCase_		:		Tuple      ,       UpperCAmelCase_		:		Optional[Any]=""	):
	forceWrite(F'''\u001b[{color}m{content}\u001b[0m'''      ,       __A	)





def __snake_case      (   ):
	forceWrite("\r"	)





def __snake_case      (   UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		str	):
	forceWrite(F'''\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}'''	)





def __snake_case      (   ):
	forceWrite(" " * TERMINAL_WIDTH	)
	reset_cursor()







def __snake_case      (   ):
	reset_cursor()
	forceWrite("-" * TERMINAL_WIDTH	)







'''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 __snake_case      (   UpperCAmelCase_		:		dict	):
 return (data["data"], data["target"])





def __snake_case      (   UpperCAmelCase_		:		np.ndarray      ,       UpperCAmelCase_		:		np.ndarray	):
 lowerCamelCase_  				=						XGBClassifier()
 classifier.fit(UpperCAmelCase_      ,       UpperCAmelCase_	)
 return classifier





def __snake_case      (   ):
 lowerCamelCase_  				=						load_iris()
 lowerCamelCase_				,lowerCamelCase_  				=						data_handling(UpperCAmelCase_	)
 lowerCamelCase_				,lowerCamelCase_				,lowerCamelCase_				,lowerCamelCase_  				=						train_test_split(
     UpperCAmelCase_      ,       UpperCAmelCase_      ,       test_size=0.25	)

 lowerCamelCase_  				=						iris["target_names"]

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



