



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 			_lowerCAmelCase       (					__lowerCAmelCase      )   ->					tuple:


				"""simple docstring"""

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



def 			_lowerCAmelCase       (					__lowerCAmelCase  ,  __lowerCAmelCase      )   ->					XGBClassifier:


				"""simple docstring"""

				snake_case__	:      Any     		=	XGBClassifier()
				classifier.fit(__lowerCAmelCase  ,  __lowerCAmelCase      )
				return classifier



def 			_lowerCAmelCase       (					)   ->					None:


				"""simple docstring"""

				snake_case__	:      Optional[int]     		=	load_iris()
				snake_case__		, snake_case__	:      Any     		=	data_handling(__lowerCAmelCase      )
				snake_case__		, snake_case__		, snake_case__		, snake_case__	:      str     		=	train_test_split(
				    __lowerCAmelCase  ,  __lowerCAmelCase  ,  test_size=0.25      )

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

				# Create an XGBoost Classifier from the training data
				snake_case__	:      int     		=	xgboost(__lowerCAmelCase  ,  __lowerCAmelCase      )

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


if __name__ == "__main__":
				import doctest

				doctest.testmod(verbose=True)
				main()






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


A__								=						{
    '''configuration_ctrl''': ['''CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''CTRLConfig'''],
    '''tokenization_ctrl''': ['''CTRLTokenizer'''],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				A__								=						[
				    '''CTRL_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''CTRLForSequenceClassification''',
				    '''CTRLLMHeadModel''',
				    '''CTRLModel''',
				    '''CTRLPreTrainedModel''',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				A__								=						[
				    '''TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''TFCTRLForSequenceClassification''',
				    '''TFCTRLLMHeadModel''',
				    '''TFCTRLModel''',
				    '''TFCTRLPreTrainedModel''',
				]


if TYPE_CHECKING:
				from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig
				from .tokenization_ctrl import CTRLTokenizer

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_ctrl import (
								    CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
								    CTRLForSequenceClassification,
								    CTRLLMHeadModel,
								    CTRLModel,
								    CTRLPreTrainedModel,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_ctrl import (
								    TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFCTRLForSequenceClassification,
								    TFCTRLLMHeadModel,
								    TFCTRLModel,
								    TFCTRLPreTrainedModel,
								)

else:
				import sys

				A__								=						_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

