"""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    (   UpperCAmelCase_   :    dict  )							->      tuple:

	'''simple docstring'''





	return (data["data"], data["target"])
def   __UpperCAmelCase    (   UpperCAmelCase_   :    np.ndarray      ,							UpperCAmelCase_   :    np.ndarray  )							->      XGBClassifier:

	'''simple docstring'''





	__snake_case      :							str						=			XGBClassifier()
	classifier.fit(UpperCAmelCase_      ,							UpperCAmelCase_  )
	return classifier
def   __UpperCAmelCase    (   )							->      None:

	'''simple docstring'''





	__snake_case      :							Dict						=			load_iris()
	__snake_case		,    __snake_case      :							List[str]						=			data_handling(UpperCAmelCase_  )
	__snake_case		,    __snake_case		,    __snake_case		,    __snake_case      :							List[Any]						=			train_test_split(
	    UpperCAmelCase_      ,							UpperCAmelCase_      ,							test_size=0.25  )

	__snake_case      :							Optional[int]						=			iris['target_names']

	# Create an XGBoost Classifier from the training data
	__snake_case      :							Union[str, Any]						=			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()






"""simple docstring"""







def   __UpperCAmelCase    (   UpperCAmelCase_   :    int      ,							UpperCAmelCase_   :    int  )							->      int:

	'''simple docstring'''





	while a != 0:
		__snake_case		,    __snake_case      :							Union[str, Any]						=			b % a, a
	return b

def   __UpperCAmelCase    (   UpperCAmelCase_   :    int      ,							UpperCAmelCase_   :    int  )							->      int:

	'''simple docstring'''





	if gcd(UpperCAmelCase_      ,							UpperCAmelCase_  ) != 1:
		__snake_case      :							Union[str, Any]						=			F"mod inverse of {a!r} and {m!r} does not exist"
		raise ValueError(UpperCAmelCase_  )
	__snake_case		,    __snake_case		,    __snake_case      :							List[str]						=			1, 0, a
	__snake_case		,    __snake_case		,    __snake_case      :							Dict						=			0, 1, m
	while va != 0:
		__snake_case      :							List[str]						=			ua // va
		__snake_case		,    __snake_case		,    __snake_case		,    __snake_case		,    __snake_case		,    __snake_case      :							List[str]						=			(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
	return ua % m





