



'''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     (      lowerCAmelCase_  )			->      tuple:
		return (data["data"], data["target"])



def      __lowerCamelCase     (      lowerCAmelCase_						,			lowerCAmelCase_  )			->      XGBClassifier:
		_a     :      int        =							XGBClassifier()
		classifier.fit(lowerCAmelCase_						,			lowerCAmelCase_  )
		return classifier



def      __lowerCamelCase     (      )			->      None:
		_a     :      Optional[Any]        =							load_iris()
		_a       ,					_a     :      List[Any]        =							data_handling(lowerCAmelCase_  )
		_a       ,					_a       ,					_a       ,					_a     :      int        =							train_test_split(
		    lowerCAmelCase_						,			lowerCAmelCase_						,			test_size=0.25  )

		_a     :      str        =							iris['target_names']

		# Create an XGBoost Classifier from the training data
		_a     :      Any        =							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 ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowerCAmelCase    :int     =					logging.get_logger(__name__)

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





     '''simple docstring'''



     a__									='''mgp-str'''





     def __init__(					self       ,	A=[3_2, 1_2_8]       ,	A=4       ,	A=3       ,	A=2_7       ,	A=3_8       ,	A=5_0_2_5_7       ,	A=3_0_5_2_2       ,	A=7_6_8       ,	A=1_2       ,	A=1_2       ,	A=4.0       ,	A=True       ,	A=False       ,	A=1E-5       ,	A=0.0       ,	A=0.0       ,	A=0.0       ,	A=False       ,	A=0.02       ,	**A       ,	)							->					Union[str, Any]:
         super().__init__(**A		)

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


