






'''simple docstring'''



class 				__SCREAMING_SNAKE_CASE							:




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



         '''simple docstring'''
         __a					  =     name
         __a					  =     value
         __a					  =     weight




      def __repr__(	self   )				->Union[str, Any]:



         '''simple docstring'''
         return F"""{self.__class__.__name__}({self.name}, {self.value}, {self.weight})"""




      def 			__UpperCamelCase				(	self   )				->str:



         '''simple docstring'''
         return self.value




      def 			__UpperCamelCase				(	self   )				->Tuple:



         '''simple docstring'''
         return self.name




      def 			__UpperCamelCase				(	self   )				->Optional[Any]:



         '''simple docstring'''
         return self.weight






      def 			__UpperCamelCase				(	self   )				->Optional[Any]:



         '''simple docstring'''
         return self.value / self.weight







def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						Dict,       SCREAMING_SNAKE_CASE__:						List[str],       SCREAMING_SNAKE_CASE__:						str     )	->      str:

   """simple docstring"""
   __a					  =     []
   for i in range(len(__a     )     ):
      menu.append(Things(name[i],       value[i],       weight[i]     )     )
   return menu



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						Any,       SCREAMING_SNAKE_CASE__:						List[str],       SCREAMING_SNAKE_CASE__:						str     )	->      Optional[Any]:

   """simple docstring"""
   __a					  =     sorted(__a,       key=__a,       reverse=__a     )
   __a					  =     []
   __a					  =     0.0, 0.0
   for i in range(len(__a     )     ):
      if (total_cost + items_copy[i].get_weight()) <= max_cost:
         result.append(items_copy[i]     )
         total_cost += items_copy[i].get_weight()
         total_value += items_copy[i].get_value()
   return (result, total_value)



def  __UpperCAmelCase						(					)	->      List[str]:

   """simple docstring"""





if __name__ == "__main__":
 import doctest

 doctest.testmod()




"""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_					(				__a   :			dict						):




			'''simple docstring'''



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

def     UpperCAmelCase_					(				__a   :			np.ndarray      ,							__a   :			np.ndarray						):




			'''simple docstring'''



			_lowerCamelCase					:					Dict	       =    XGBClassifier()
			classifier.fit(__a      ,							__a						)
			return classifier

def     UpperCAmelCase_					(				):




			'''simple docstring'''



			_lowerCamelCase					:					List[str]	       =    load_iris()
			_lowerCamelCase       ,							_lowerCamelCase					:					Optional[Any]	       =    data_handling(__a						)
			_lowerCamelCase       ,							_lowerCamelCase       ,							_lowerCamelCase       ,							_lowerCamelCase					:					int	       =    train_test_split(
			    __a      ,							__a      ,							test_size=0.2_5						)

			_lowerCamelCase					:					Optional[Any]	       =    iris['target_names']

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





