




'''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 						snake_case_							(_a	:							dict     ):
    return (data["data"], data["target"])





def 						snake_case_							(_a	:							np.ndarray    ,   _a	:							np.ndarray     ):
    UpperCAmelCase			       =		XGBClassifier()
    classifier.fit(_a    ,   _a     )
    return classifier





def 						snake_case_							():
    UpperCAmelCase			       =		load_iris()
    UpperCAmelCase       ,     UpperCAmelCase			       =		data_handling(_a     )
    UpperCAmelCase       ,     UpperCAmelCase       ,     UpperCAmelCase       ,     UpperCAmelCase			       =		train_test_split(
        _a    ,   _a    ,   test_size=0.25     )

    UpperCAmelCase			       =		iris['''target_names''']

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







def 	snake_case__			(    SCREAMING_SNAKE_CASE_		:    str	,     SCREAMING_SNAKE_CASE_		:    str			):



     '''simple docstring'''





     if len(SCREAMING_SNAKE_CASE_			) != len(SCREAMING_SNAKE_CASE_			):
          raise ValueError('String lengths must match!'			)

     lowercase__    :   Union[str, Any]      =       0

     for chara, chara in zip(SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_			):
          if chara != chara:
               count += 1

     return count


if __name__ == "__main__":
       import doctest

       doctest.testmod()

