


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




     '''simple docstring'''



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






def 		_A			(lowerCAmelCase__					:np.ndarray			,  lowerCAmelCase__					:np.ndarray						)				->					XGBClassifier:




     '''simple docstring'''



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






def 		_A			()				->					None:




     '''simple docstring'''



     _a      =							load_iris()
     _a ,				_a      =							data_handling(lowerCAmelCase__						)
     _a ,				_a ,				_a ,				_a      =							train_test_split(
         lowerCAmelCase__			,  lowerCAmelCase__			,  test_size=0.2_5						)

     _a      =							iris['target_names']

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





'''simple docstring'''






from typing import TYPE_CHECKING

from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
from ...utils import OptionalDependencyNotAvailable


a_   :      List[Any]				    =      {"configuration_gpt_neox": ["GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoXConfig"]}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :      List[str]				    =      ["GPTNeoXTokenizerFast"]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :      List[Any]				    =      [
     "GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST",
     "GPTNeoXForCausalLM",
     "GPTNeoXForQuestionAnswering",
     "GPTNeoXForSequenceClassification",
     "GPTNeoXForTokenClassification",
     "GPTNeoXLayer",
     "GPTNeoXModel",
     "GPTNeoXPreTrainedModel",
 ]


if TYPE_CHECKING:
 from .configuration_gpt_neox import GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXConfig

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_gpt_neox_fast import GPTNeoXTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_gpt_neox import (
      GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST,
      GPTNeoXForCausalLM,
      GPTNeoXForQuestionAnswering,
      GPTNeoXForSequenceClassification,
      GPTNeoXForTokenClassification,
      GPTNeoXLayer,
      GPTNeoXModel,
      GPTNeoXPreTrainedModel,
  )


else:
 import sys

 a_   :      Optional[Any]				    =      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

