






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__							(							UpperCAmelCase							:  dict       ):
    return (data["data"], data["target"])


def 				snake_case__							(							UpperCAmelCase							:  np.ndarray    ,			UpperCAmelCase							:  np.ndarray       ):
    lowerCAmelCase__   :Any      							=				XGBClassifier()
    classifier.fit(SCREAMING_SNAKE_CASE__    ,			SCREAMING_SNAKE_CASE__       )
    return classifier


def 				snake_case__							(							):
    lowerCAmelCase__   :Any      							=				load_iris()
    lowerCAmelCase__   :Tuple      							=				data_handling(SCREAMING_SNAKE_CASE__       )
    lowerCAmelCase__   :str      							=				train_test_split(
        SCREAMING_SNAKE_CASE__    ,			SCREAMING_SNAKE_CASE__    ,			test_size=0.25       )

    lowerCAmelCase__   :Union[str, Any]      							=				iris["""target_names"""]

    # Create an XGBoost Classifier from the training data
    lowerCAmelCase__   :Optional[int]      							=				xgboost(SCREAMING_SNAKE_CASE__    ,			SCREAMING_SNAKE_CASE__       )

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


if __name__ == "__main__":
  import doctest

  doctest.testmod(verbose=True)
  main()











from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_a    :   Tuple        =			logging.get_logger(__name__)

_a    :   Optional[int]        =			{
    """facebook/levit-128S""": """https://huggingface.co/facebook/levit-128S/resolve/main/config.json""",
    # See all LeViT models at https://huggingface.co/models?filter=levit
}







class 	_UpperCAmelCase  (  _A		):




      """simple docstring"""



      A          =    '''levit'''
      def __init__(   self    ,	_lowerCAmelCase=224    ,	_lowerCAmelCase=3    ,	_lowerCAmelCase=3    ,	_lowerCAmelCase=2    ,	_lowerCAmelCase=1    ,	_lowerCAmelCase=16    ,	_lowerCAmelCase=[128, 256, 384]    ,	_lowerCAmelCase=[4, 8, 12]    ,	_lowerCAmelCase=[4, 4, 4]    ,	_lowerCAmelCase=[16, 16, 16]    ,	_lowerCAmelCase=0    ,	_lowerCAmelCase=[2, 2, 2]    ,	_lowerCAmelCase=[2, 2, 2]    ,	_lowerCAmelCase=0.02    ,	**_lowerCAmelCase    ,	):



          '''simple docstring'''
          super().__init__(**_lowerCAmelCase		)
          lowerCAmelCase__   :List[str]      							=				image_size
          lowerCAmelCase__   :Dict      							=				num_channels
          lowerCAmelCase__   :List[Any]      							=				kernel_size
          lowerCAmelCase__   :List[Any]      							=				stride
          lowerCAmelCase__   :Tuple      							=				padding
          lowerCAmelCase__   :str      							=				hidden_sizes
          lowerCAmelCase__   :Union[str, Any]      							=				num_attention_heads
          lowerCAmelCase__   :Optional[int]      							=				depths
          lowerCAmelCase__   :Union[str, Any]      							=				key_dim
          lowerCAmelCase__   :str      							=				drop_path_rate
          lowerCAmelCase__   :int      							=				patch_size
          lowerCAmelCase__   :Dict      							=				attention_ratio
          lowerCAmelCase__   :Dict      							=				mlp_ratio
          lowerCAmelCase__   :Optional[int]      							=				initializer_range
          lowerCAmelCase__   :Tuple      							=				[
              ["Subsample", key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
              ["Subsample", key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
          ]







class 	_UpperCAmelCase  (  _A		):




      """simple docstring"""



      A          =    version.parse('''1.11'''		)
      @property
      def 			snake_case_      (   self		):



          '''simple docstring'''
          return OrderedDict(
              [
                  ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
              ]		)



      @property
      def 			snake_case_      (   self		):



          '''simple docstring'''
          return 1e-4



