





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__       (    SCREAMING_SNAKE_CASE_   :      dict						)  ->  tuple:






   """simple docstring"""







   return (data["data"], data["target"])
def      A__       (    SCREAMING_SNAKE_CASE_   :      np.ndarray				,	SCREAMING_SNAKE_CASE_   :      np.ndarray						)  ->  XGBClassifier:






   """simple docstring"""







   _UpperCAmelCase           =   XGBClassifier()
   classifier.fit(SCREAMING_SNAKE_CASE_				,	SCREAMING_SNAKE_CASE_						)
   return classifier
def      A__       (    )  ->  None:






   """simple docstring"""







   _UpperCAmelCase           =   load_iris()
   _UpperCAmelCase       ,      _UpperCAmelCase           =   data_handling(SCREAMING_SNAKE_CASE_						)
   _UpperCAmelCase       ,      _UpperCAmelCase       ,      _UpperCAmelCase       ,      _UpperCAmelCase           =   train_test_split(
       SCREAMING_SNAKE_CASE_				,	SCREAMING_SNAKE_CASE_				,	test_size=0.2_5						)

   _UpperCAmelCase           =   iris['''target_names''']

   # Create an XGBoost Classifier from the training data
   _UpperCAmelCase           =   xgboost(SCREAMING_SNAKE_CASE_				,	SCREAMING_SNAKE_CASE_						)

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


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   main()






import numpy as np
def      A__       (    SCREAMING_SNAKE_CASE_   :      np.ndarray				,	SCREAMING_SNAKE_CASE_   :      float						)  ->  np.ndarray:






   """simple docstring"""







   return np.where(vector > 0				,	SCREAMING_SNAKE_CASE_				,	(alpha * (np.exp(SCREAMING_SNAKE_CASE_						) - 1))						)


if __name__ == "__main__":
   import doctest

   doctest.testmod()