



'''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  lowerCamelCase__			(		_A							):
  return (data["data"], data["target"])
def  lowerCamelCase__			(		_A					,     _A							):
  a		:   int	  =	XGBClassifier()
  classifier.fit(_A					,     _A							)
  return classifier
def  lowerCamelCase__			(		):
  a		:   Optional[int]	  =	load_iris()
  a  ,      a		:   Any	  =	data_handling(_A							)
  a  ,      a  ,      a  ,      a		:   Union[str, Any]	  =	train_test_split(
      _A					,     _A					,     test_size=0.25							)

  a		:   List[str]	  =	iris['target_names']

  # Create an XGBoost Classifier from the training data
  a		:   Optional[Any]	  =	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()




'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


lowerCAmelCase:   List[Any]					=		{'configuration_reformer': ['REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ReformerConfig']}

try:
     if not is_sentencepiece_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCAmelCase:   Dict					=		['ReformerTokenizer']

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCAmelCase:   Tuple					=		['ReformerTokenizerFast']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCAmelCase:   List[Any]					=		[
         'REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
         'ReformerAttention',
         'ReformerForMaskedLM',
         'ReformerForQuestionAnswering',
         'ReformerForSequenceClassification',
         'ReformerLayer',
         'ReformerModel',
         'ReformerModelWithLMHead',
         'ReformerPreTrainedModel',
     ]


if TYPE_CHECKING:
     from .configuration_reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig

     try:
          if not is_sentencepiece_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_reformer import ReformerTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_reformer_fast import ReformerTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_reformer import (
              REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
              ReformerAttention,
              ReformerForMaskedLM,
              ReformerForQuestionAnswering,
              ReformerForSequenceClassification,
              ReformerLayer,
              ReformerModel,
              ReformerModelWithLMHead,
              ReformerPreTrainedModel,
          )

else:
     import sys

     lowerCAmelCase:   str					=		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)