



"""simple docstring"""
import unittest

from knapsack import knapsack as k
class 					a	(  unittest.TestCase       ):



  def 	lowerCamelCase__       (						self :					List[str]		)     ->					Any:


     '''simple docstring'''




     SCREAMING_SNAKE_CASE_: Dict     			=0
     SCREAMING_SNAKE_CASE_: List[str]     			=[0]
     SCREAMING_SNAKE_CASE_: str     			=[0]
     SCREAMING_SNAKE_CASE_: Tuple     			=len(lowercase__		)
     self.assertEqual(k.knapsack(lowercase__       ,		lowercase__       ,		lowercase__       ,		lowercase__		)       ,		0		)

     SCREAMING_SNAKE_CASE_: Tuple     			=[60]
     SCREAMING_SNAKE_CASE_: Union[str, Any]     			=[10]
     SCREAMING_SNAKE_CASE_: List[str]     			=len(lowercase__		)
     self.assertEqual(k.knapsack(lowercase__       ,		lowercase__       ,		lowercase__       ,		lowercase__		)       ,		0		)



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


     '''simple docstring'''




     SCREAMING_SNAKE_CASE_: Any     			=3
     SCREAMING_SNAKE_CASE_: Optional[Any]     			=[1, 2, 3]
     SCREAMING_SNAKE_CASE_: int     			=[3, 2, 1]
     SCREAMING_SNAKE_CASE_: List[Any]     			=len(lowercase__		)
     self.assertEqual(k.knapsack(lowercase__       ,		lowercase__       ,		lowercase__       ,		lowercase__		)       ,		5		)





  def 	lowerCamelCase__       (						self :					int		)     ->					Tuple:


     '''simple docstring'''




     SCREAMING_SNAKE_CASE_: Dict     			=50
     SCREAMING_SNAKE_CASE_: List[str]     			=[60, 100, 120]
     SCREAMING_SNAKE_CASE_: Optional[int]     			=[10, 20, 30]
     SCREAMING_SNAKE_CASE_: Dict     			=len(lowercase__		)
     self.assertEqual(k.knapsack(lowercase__       ,		lowercase__       ,		lowercase__       ,		lowercase__		)       ,		220		)


if __name__ == "__main__":
   unittest.main()








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





def      __magic_name__				(							lowercase							,			lowercase ):
   SCREAMING_SNAKE_CASE_: Dict     			=XGBClassifier()
   classifier.fit(lowercase							,			lowercase )
   return classifier





def      __magic_name__				(							):
   SCREAMING_SNAKE_CASE_: Optional[Any]     			=load_iris()
   SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_: Tuple     			=data_handling(lowercase )
   SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_: List[Any]     			=train_test_split(
       lowercase							,			lowercase							,			test_size=0.25 )

   SCREAMING_SNAKE_CASE_: Tuple     			=iris["""target_names"""]

   # Create an XGBoost Classifier from the training data
   SCREAMING_SNAKE_CASE_: Optional[int]     			=xgboost(lowercase							,			lowercase )

   # Display the confusion matrix of the classifier with both training and test sets
   ConfusionMatrixDisplay.from_estimator(
       lowercase							,			lowercase							,			lowercase							,			display_labels=lowercase							,			cmap="""Blues"""							,			normalize="""true"""							,			)
   plt.title("""Normalized Confusion Matrix - IRIS Dataset""" )
   plt.show()


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   main()



