





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 			_a		(       UpperCAmelCase	)							->							tuple:







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



def 			_a		(       UpperCAmelCase     ,    UpperCAmelCase	)							->							XGBClassifier:







   """simple docstring"""
   lowerCamelCase__  :		Any     =				XGBClassifier()
   classifier.fit(__a     ,    __a	)
   return classifier



def 			_a		(       )							->							None:







   """simple docstring"""
   lowerCamelCase__  :		Optional[int]     =				load_iris()
   lowerCamelCase__  ,				lowerCamelCase__  :		List[Any]     =				data_handling(__a	)
   lowerCamelCase__  ,				lowerCamelCase__  ,				lowerCamelCase__  ,				lowerCamelCase__  :		List[str]     =				train_test_split(
       __a     ,    __a     ,    test_size=0.25	)

   lowerCamelCase__  :		Tuple     =				iris['''target_names''']

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










class     A     :
			'''simple docstring'''




			def __init__(     self  :       Optional[int]  )      ->      Dict:







					"""simple docstring"""






					A__     =  {}






			def   a_			(     self  :       Any  )      ->      None:







					"""simple docstring"""






					print(self.vertex  )
					for i in self.vertex:
							print(__lowerCAmelCase				,      """ -> """				,      """ -> """.join([str(__lowerCAmelCase  ) for j in self.vertex[i]]  )  )






			def   a_			(     self  :       Optional[int]				,      __lowerCAmelCase  :       int				,      __lowerCAmelCase  :       int  )      ->      None:







					"""simple docstring"""






					if from_vertex in self.vertex:
							self.vertex[from_vertex].append(__lowerCAmelCase  )
					else:
							# else make a new vertex
							A__     =  [to_vertex]






			def   a_			(     self  :       List[str]  )      ->      None:







					"""simple docstring"""






					A__     =  [False] * len(self.vertex  )

					# call the recursive helper function
					for i in range(len(self.vertex  )  ):
							if not visited[i]:
									self.dfs_recursive(__lowerCAmelCase				,      __lowerCAmelCase  )







			def   a_			(     self  :       List[str]				,      __lowerCAmelCase  :       int				,      __lowerCAmelCase  :       list  )      ->      None:







					"""simple docstring"""






					A__     =  True

					print(__lowerCAmelCase				,      end=""" """  )

					# Recur for all the vertices that are adjacent to this node
					for i in self.vertex:
							if not visited[i]:
									self.dfs_recursive(__lowerCAmelCase				,      __lowerCAmelCase  )


if __name__ == "__main__":
					A       :   Tuple					= Graph()
					g.add_edge(0, 1)
					g.add_edge(0, 2)
					g.add_edge(1, 2)
					g.add_edge(2, 0)
					g.add_edge(2, 3)
					g.add_edge(3, 3)

					g.print_graph()
					print('''DFS:''')
					g.dfs()

					# OUTPUT:
					# 0  ->  1 -> 2
					# 1  ->  2
					# 2  ->  0 -> 3
					# 3  ->  3
					# DFS:
					#  0 1 2 3



