
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_ (				lowerCamelCase__    ):
				return (data["data"], data["target"])





def 			lowerCamelCase_ (				lowerCamelCase__	, lowerCamelCase__    ):
				lowerCamelCase_						=			XGBClassifier()
				classifier.fit(lowerCamelCase__	, lowerCamelCase__    )
				return classifier





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

				lowerCamelCase_						=			iris["target_names"]

				# Create an XGBoost Classifier from the training data
				lowerCamelCase_						=			xgboost(lowerCamelCase__	, lowerCamelCase__    )

				# Display the confusion matrix of the classifier with both training and test sets
				ConfusionMatrixDisplay.from_estimator(
				    lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__	, display_labels=lowerCamelCase__	, 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      __lowerCamelCase   (							a_     :		int ,   a_     :		str							)			->      Optional[int]:
      __SCREAMING_SNAKE_CASE   :Optional[int]						=  [1]
      for i in range(2 ,   a_							):
            factorials.append(factorials[-1] * i							)
      assert 0 <= k < factorials[-1] * n, "k out of bounds"

      __SCREAMING_SNAKE_CASE   :List[str]						=  []
      __SCREAMING_SNAKE_CASE   :Optional[Any]						=  list(range(a_							)							)

      # Find permutation
      while factorials:
            __SCREAMING_SNAKE_CASE   :Optional[int]						=  factorials.pop()
            __SCREAMING_SNAKE_CASE				,__SCREAMING_SNAKE_CASE   :Dict						=  divmod(a_ ,   a_							)
            permutation.append(elements[number]							)
            elements.remove(elements[number]							)
      permutation.append(elements[0]							)

      return permutation


if __name__ == "__main__":
  import doctest

  doctest.testmod()