





from typing import List

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCAmelCase_    =    logging.get_logger(__name__)

lowerCAmelCase_    =    {
    '''snap-research/efficientformer-l1-300''': (
        '''https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'''
    ),
}



class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					Tuple	      =				'''efficientformer'''






			def __init__(self ,							__magic_name__ = [3, 2, 6, 4] ,							__magic_name__ = [48, 96, 224, 448] ,							__magic_name__ = [True, True, True, True] ,							__magic_name__ = 448 ,							__magic_name__ = 32 ,							__magic_name__ = 4 ,							__magic_name__ = 7 ,							__magic_name__ = 5 ,							__magic_name__ = 8 ,							__magic_name__ = 4 ,							__magic_name__ = 0.0 ,							__magic_name__ = 16 ,							__magic_name__ = 3 ,							__magic_name__ = 3 ,							__magic_name__ = 3 ,							__magic_name__ = 2 ,							__magic_name__ = 1 ,							__magic_name__ = 0.0 ,							__magic_name__ = 1 ,							__magic_name__ = True ,							__magic_name__ = True ,							__magic_name__ = 1e-5 ,							__magic_name__ = "gelu" ,							__magic_name__ = 0.02 ,							__magic_name__ = 1e-12 ,							__magic_name__ = 224 ,							__magic_name__ = 1e-05 ,							**__magic_name__ ,							)					->       None:


							'''simple docstring'''



							super().__init__(**__magic_name__   )

							snake_case_						:   Optional[Any]           =  hidden_act
							snake_case_						:   Any           =  hidden_dropout_prob
							snake_case_						:   List[Any]           =  hidden_sizes
							snake_case_						:   str           =  num_hidden_layers
							snake_case_						:   List[Any]           =  num_attention_heads
							snake_case_						:   List[str]           =  initializer_range
							snake_case_						:   Optional[int]           =  layer_norm_eps
							snake_case_						:   Optional[int]           =  patch_size
							snake_case_						:   List[Any]           =  num_channels
							snake_case_						:   str           =  depths
							snake_case_						:   Optional[Any]           =  mlp_expansion_ratio
							snake_case_						:   List[str]           =  downsamples
							snake_case_						:   Tuple           =  dim
							snake_case_						:   List[str]           =  key_dim
							snake_case_						:   List[Any]           =  attention_ratio
							snake_case_						:   List[Any]           =  resolution
							snake_case_						:   Tuple           =  pool_size
							snake_case_						:   Any           =  downsample_patch_size
							snake_case_						:   List[str]           =  downsample_stride
							snake_case_						:   Union[str, Any]           =  downsample_pad
							snake_case_						:   Union[str, Any]           =  drop_path_rate
							snake_case_						:   Optional[Any]           =  num_metaad_blocks
							snake_case_						:   str           =  distillation
							snake_case_						:   int           =  use_layer_scale
							snake_case_						:   List[str]           =  layer_scale_init_value
							snake_case_						:   Union[str, Any]           =  image_size
							snake_case_						:   Optional[int]           =  batch_norm_eps







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_						(    _UpperCamelCase			)		->						tuple:






				"""simple docstring"""


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






def 					lowerCamelCase_						(    _UpperCamelCase			,    _UpperCamelCase			)		->						XGBClassifier:






				"""simple docstring"""


				snake_case_						:   Optional[Any]           =  XGBClassifier()
				classifier.fit(_UpperCamelCase			,    _UpperCamelCase			)
				return classifier






def 					lowerCamelCase_						(    )		->						None:






				"""simple docstring"""


				snake_case_						:   Optional[Any]           =  load_iris()
				snake_case_      ,							snake_case_						:   str           =  data_handling(_UpperCamelCase			)
				snake_case_      ,							snake_case_      ,							snake_case_      ,							snake_case_						:   Dict           =  train_test_split(
				    _UpperCamelCase			,    _UpperCamelCase			,    test_size=0.25			)

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

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