


'''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 __snake_case					(      UpperCAmelCase_						:						List[str]		):
 return (data["data"], data["target"])





def __snake_case					(      UpperCAmelCase_						:						Optional[int]					,				UpperCAmelCase_						:						Optional[int]		):
 lowerCamelCase_      =  XGBClassifier()
 classifier.fit(_UpperCamelCase					,				_UpperCamelCase		)
 return classifier





def __snake_case					(      ):
 lowerCamelCase_      =  load_iris()
 lowerCamelCase_ ,lowerCamelCase_      =  data_handling(_UpperCamelCase		)
 lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_      =  train_test_split(
     _UpperCamelCase					,				_UpperCamelCase					,				test_size=0.25		)

 lowerCamelCase_      =  iris["target_names"]

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







"""simple docstring"""


import logging
from dataclasses import dataclass, field
from typing import Optional

from seqaseq_trainer import arg_to_scheduler

from transformers import TrainingArguments


A     :   Dict			    =			logging.getLogger(__name__)
@dataclass
class   _UpperCamelCase  (   lowerCAmelCase__		):
							'''simple docstring'''







							__UpperCAmelCase						:    Optional[float]				      =field(
							    default=0.0       ,metadata={"""help""": """The label smoothing epsilon to apply (if not zero)."""}		)
							__UpperCAmelCase						:    bool				      =field(default=lowerCAmelCase__       ,metadata={"""help""": """Whether to SortishSamler or not."""}		)
							__UpperCAmelCase						:    bool				      =field(
							    default=lowerCAmelCase__       ,metadata={"""help""": """Whether to use generate to calculate generative metrics (ROUGE, BLEU)."""}		)
							__UpperCAmelCase						:    bool				      =field(default=lowerCAmelCase__       ,metadata={"""help""": """whether to use adafactor"""}		)
							__UpperCAmelCase						:    Optional[float]				      =field(
							    default=lowerCAmelCase__       ,metadata={"""help""": """Encoder layer dropout probability. Goes into model.config."""}		)
							__UpperCAmelCase						:    Optional[float]				      =field(
							    default=lowerCAmelCase__       ,metadata={"""help""": """Decoder layer dropout probability. Goes into model.config."""}		)
							__UpperCAmelCase						:    Optional[float]				      =field(default=lowerCAmelCase__       ,metadata={"""help""": """Dropout probability. Goes into model.config."""}		)
							__UpperCAmelCase						:    Optional[float]				      =field(
							    default=lowerCAmelCase__       ,metadata={"""help""": """Attention dropout probability. Goes into model.config."""}		)
							__UpperCAmelCase						:    Optional[str]				      =field(
							    default="""linear"""       ,metadata={"""help""": F'''Which lr scheduler to use. Selected in {sorted(arg_to_scheduler.keys()		)}'''}       ,)




