


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




      """simple docstring"""





      return (data["data"], data["target"])
def 							__lowerCamelCase		(					UpperCAmelCase_		:						np.ndarray					,    UpperCAmelCase_		:						np.ndarray		):




      """simple docstring"""





      a		:Optional[int]									=			XGBClassifier()
      classifier.fit(UpperCAmelCase_					,    UpperCAmelCase_		)
      return classifier
def 							__lowerCamelCase		(					):




      """simple docstring"""





      a		:Optional[int]									=			load_iris()
      a				,							a		:List[str]									=			data_handling(UpperCAmelCase_		)
      a				,							a				,							a				,							a		:Dict									=			train_test_split(
          UpperCAmelCase_					,    UpperCAmelCase_					,    test_size=0.25		)

      a		:int									=			iris['''target_names''']

      # Create an XGBoost Classifier from the training data
      a		:List[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()









from __future__ import annotations

from typing import Any







class 						_snake_case    ( _snake_case				):
 pass







class 						_snake_case    :




 def __init__(						self   ,    _lowerCamelCase       ):
       a		:Any									=			data
       a		:Node | None									=			None




 def __iter__(						self       ):
       a		:Dict									=			self
       a		:Optional[int]									=			[]
       while node:
             if node in visited:
                   raise ContainsLoopError
             visited.append(_lowerCamelCase       )
             yield node.data
             a		:str									=			node.next_node




 @property
 def 			SCREAMING_SNAKE_CASE__							(						self       ):
       try:
             list(self       )
             return False
       except ContainsLoopError:
             return True


if __name__ == "__main__":
     snake_case							:       int										=	Node(1)
     snake_case							:       int										=	Node(2)
     snake_case							:       Optional[int]										=	Node(3)
     snake_case							:       List[str]										=	Node(4)
     print(root_node.has_loop)  # False
     snake_case							:       Optional[Any]										=	root_node.next_node
     print(root_node.has_loop)  # True

     snake_case							:       Dict										=	Node(5)
     snake_case							:       List[Any]										=	Node(6)
     snake_case							:       Optional[int]										=	Node(5)
     snake_case							:       Union[str, Any]										=	Node(6)
     print(root_node.has_loop)  # False

     snake_case							:       Tuple										=	Node(1)
     print(root_node.has_loop)  # False





