
'''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__						):




    '''simple docstring'''



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







def 		lowerCAmelCase_				(   snake_case__		,				snake_case__						):




    '''simple docstring'''



    A       :   int					=						XGBClassifier()
    classifier.fit(snake_case__		,				snake_case__						)
    return classifier







def 		lowerCAmelCase_				(   ):




    '''simple docstring'''



    A       :   Optional[Any]					=						load_iris()
    A,  A       :   List[str]					=						data_handling(snake_case__						)
    A,  A,  A,  A       :   Optional[Any]					=						train_test_split(
        snake_case__		,				snake_case__		,				test_size=0.25						)

    A       :   Dict					=						iris['''target_names''']

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






'''simple docstring'''




import pytest

import datasets.config
from datasets.utils.info_utils import is_small_dataset







@pytest.mark.parametrize('''dataset_size'''		,				[None, 400 * 2**20, 600 * 2**20]						)
@pytest.mark.parametrize('''input_in_memory_max_size'''		,				['''default''', 0, 100 * 2**20, 900 * 2**20]						)
def 		lowerCAmelCase_				(   snake_case__		,				snake_case__		,				snake_case__						):




    '''simple docstring'''



    if input_in_memory_max_size != "default":
        monkeypatch.setattr(datasets.config		,				'''IN_MEMORY_MAX_SIZE'''		,				snake_case__						)
    A       :   Dict					=						datasets.config.IN_MEMORY_MAX_SIZE
    if input_in_memory_max_size == "default":
        assert in_memory_max_size == 0
    else:
        assert in_memory_max_size == input_in_memory_max_size
    if dataset_size and in_memory_max_size:
        A       :   Dict					=						dataset_size < in_memory_max_size
    else:
        A       :   Tuple					=						False
    A       :   int					=						is_small_dataset(snake_case__						)
    assert result == expected




