





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






def lowerCamelCase__   (							snake_case_     :  np.ndarray	,				snake_case_     :  np.ndarray	)				->    XGBClassifier:
   __snake_case								=       XGBClassifier()
   classifier.fit(snake_case_	,				snake_case_	)
   return classifier






def lowerCamelCase__   (							)				->    None:
   __snake_case								=       load_iris()
   __snake_case	,     __snake_case								=       data_handling(snake_case_	)
   __snake_case	,     __snake_case	,     __snake_case	,     __snake_case								=       train_test_split(
       snake_case_	,				snake_case_	,				test_size=0.25	)

   __snake_case								=       iris['''target_names''']

   # Create an XGBoost Classifier from the training data
   __snake_case								=       xgboost(snake_case_	,				snake_case_	)

   # Display the confusion matrix of the classifier with both training and test sets
   ConfusionMatrixDisplay.from_estimator(
       snake_case_	,				snake_case_	,				snake_case_	,				display_labels=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 typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


snake_case_           =      {}

try:
    if not is_sentencepiece_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      ['NllbTokenizer']

try:
    if not is_tokenizers_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      ['NllbTokenizerFast']


if TYPE_CHECKING:
    try:
        if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_nllb import NllbTokenizer

    try:
        if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_nllb_fast import NllbTokenizerFast

else:
    import sys

    snake_case_           =      _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

