
'''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 	A  (   UpperCamelCase_       :  dict   )       ->							tuple:







			'''simple docstring'''



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







def 	A  (   UpperCamelCase_       :  np.ndarray    ,						UpperCamelCase_       :  np.ndarray   )       ->							XGBClassifier:







			'''simple docstring'''



			lowerCAmelCase__										=				XGBClassifier()
			classifier.fit(UpperCamelCase_    ,						UpperCamelCase_   )
			return classifier







def 	A  (   )       ->							None:







			'''simple docstring'''



			lowerCAmelCase__										=				load_iris()
			lowerCAmelCase__						,lowerCAmelCase__										=				data_handling(UpperCamelCase_   )
			lowerCAmelCase__						,lowerCAmelCase__						,lowerCAmelCase__						,lowerCAmelCase__										=				train_test_split(
			    UpperCamelCase_    ,						UpperCamelCase_    ,						test_size=0.25   )

			lowerCAmelCase__										=				iris["target_names"]

			# Create an XGBoost Classifier from the training data
			lowerCAmelCase__										=				xgboost(UpperCamelCase_    ,						UpperCamelCase_   )

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


if __name__ == "__main__":
		import doctest

		doctest.testmod(verbose=True)
		main()













"""simple docstring"""





from transformers import DistilBertTokenizer, DistilBertTokenizerFast
from transformers.testing_utils import require_tokenizers, slow

from ..bert.test_tokenization_bert import BertTokenizationTest






@require_tokenizers
class 	a		(   __snake_case						):
    SCREAMING_SNAKE_CASE		:	Optional[Any]		=					DistilBertTokenizer
    SCREAMING_SNAKE_CASE		:	Optional[Any]		=					DistilBertTokenizerFast
    SCREAMING_SNAKE_CASE		:	int		=					True






    @slow
    def   UpperCamelCase			(			self	:				Optional[int]   )	->						int:
      lowerCamelCase_       	=		DistilBertTokenizer.from_pretrained('distilbert-base-uncased'   )

      lowerCamelCase_       	=		tokenizer.encode('sequence builders'			,		add_special_tokens=__SCREAMING_SNAKE_CASE   )
      lowerCamelCase_       	=		tokenizer.encode('multi-sequence build'			,		add_special_tokens=__SCREAMING_SNAKE_CASE   )

      lowerCamelCase_       	=		tokenizer.build_inputs_with_special_tokens(__SCREAMING_SNAKE_CASE   )
      lowerCamelCase_       	=		tokenizer.build_inputs_with_special_tokens(__SCREAMING_SNAKE_CASE			,		__SCREAMING_SNAKE_CASE   )

      assert encoded_sentence == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id]
      assert encoded_pair == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_a + [
          tokenizer.sep_token_id
      ]




