



"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


_UpperCAmelCase     :   Optional[Any]     =			logging.get_logger(__name__)

_UpperCAmelCase     :   Dict     =			{
    """alibaba-damo/mgp-str-base""": """https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json""",
}
class 					a	(  _snake_case       ):
  UpperCamelCase	:				Union[str, Any]     						=					'mgp-str'



  def __init__(						self :					Union[str, Any]       ,		lowerCAmelCase :					str=[32, 128]       ,		lowerCAmelCase :					int=4       ,		lowerCAmelCase :					int=3       ,		lowerCAmelCase :					List[str]=27       ,		lowerCAmelCase :					int=38       ,		lowerCAmelCase :					List[Any]=5_0257       ,		lowerCAmelCase :					Any=3_0522       ,		lowerCAmelCase :					Optional[int]=768       ,		lowerCAmelCase :					Optional[int]=12       ,		lowerCAmelCase :					Union[str, Any]=12       ,		lowerCAmelCase :					Optional[int]=4.0       ,		lowerCAmelCase :					Optional[Any]=True       ,		lowerCAmelCase :					Tuple=False       ,		lowerCAmelCase :					Tuple=1E-5       ,		lowerCAmelCase :					Union[str, Any]=0.0       ,		lowerCAmelCase :					Optional[int]=0.0       ,		lowerCAmelCase :					int=0.0       ,		lowerCAmelCase :					Dict=False       ,		lowerCAmelCase :					Optional[int]=0.0_2       ,		**lowerCAmelCase :					str       ,		)     ->					Dict:


     '''simple docstring'''




     super().__init__(**lowerCAmelCase__		)

     SCREAMING_SNAKE_CASE_: Optional[int]     			=image_size
     SCREAMING_SNAKE_CASE_: Tuple     			=patch_size
     SCREAMING_SNAKE_CASE_: str     			=num_channels
     SCREAMING_SNAKE_CASE_: List[str]     			=max_token_length
     SCREAMING_SNAKE_CASE_: Optional[int]     			=num_character_labels
     SCREAMING_SNAKE_CASE_: List[str]     			=num_bpe_labels
     SCREAMING_SNAKE_CASE_: Optional[int]     			=num_wordpiece_labels
     SCREAMING_SNAKE_CASE_: Optional[int]     			=hidden_size
     SCREAMING_SNAKE_CASE_: Union[str, Any]     			=num_hidden_layers
     SCREAMING_SNAKE_CASE_: int     			=num_attention_heads
     SCREAMING_SNAKE_CASE_: Union[str, Any]     			=mlp_ratio
     SCREAMING_SNAKE_CASE_: Optional[Any]     			=distilled
     SCREAMING_SNAKE_CASE_: Optional[int]     			=layer_norm_eps
     SCREAMING_SNAKE_CASE_: Optional[Any]     			=drop_rate
     SCREAMING_SNAKE_CASE_: Optional[int]     			=qkv_bias
     SCREAMING_SNAKE_CASE_: Optional[Any]     			=attn_drop_rate
     SCREAMING_SNAKE_CASE_: List[Any]     			=drop_path_rate
     SCREAMING_SNAKE_CASE_: Optional[int]     			=output_aa_attentions
     SCREAMING_SNAKE_CASE_: Tuple     			=initializer_range








"""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      __magic_name__				(							lowercase ):
   return (data["data"], data["target"])





def      __magic_name__				(							lowercase							,			lowercase ):
   SCREAMING_SNAKE_CASE_: Dict     			=XGBClassifier()
   classifier.fit(lowercase							,			lowercase )
   return classifier





def      __magic_name__				(							):
   SCREAMING_SNAKE_CASE_: Optional[Any]     			=load_iris()
   SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_: Tuple     			=data_handling(lowercase )
   SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_: List[Any]     			=train_test_split(
       lowercase							,			lowercase							,			test_size=0.25 )

   SCREAMING_SNAKE_CASE_: Tuple     			=iris["""target_names"""]

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

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


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   main()



