





import pytest

import datasets


# Import fixture modules as plugins
lowerCAmelCase_    =    ["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]






def 					lowerCamelCase_						(    _UpperCamelCase			,    _UpperCamelCase			)		->						Optional[int]:






				"""simple docstring"""


				for item in items:
								if any(marker in item.keywords for marker in ['''integration''', '''unit''']			):
												continue
								item.add_marker(pytest.mark.unit			)






def 					lowerCamelCase_						(    _UpperCamelCase			)		->						Union[str, Any]:






				"""simple docstring"""


				config.addinivalue_line('''markers'''			,    '''torchaudio_latest: mark test to run with torchaudio>=0.12'''			)






@pytest.fixture(autouse=A__			)
def 					lowerCamelCase_						(    _UpperCamelCase			,    _UpperCamelCase			)		->						List[str]:






				"""simple docstring"""


				snake_case_						:   str           =  tmp_path_factory.getbasetemp() / """cache"""
				snake_case_						:   Dict           =  test_hf_cache_home / """datasets"""
				snake_case_						:   int           =  test_hf_cache_home / """metrics"""
				snake_case_						:   List[Any]           =  test_hf_cache_home / """modules"""
				monkeypatch.setattr('''datasets.config.HF_DATASETS_CACHE'''			,    str(A__			)			)
				monkeypatch.setattr('''datasets.config.HF_METRICS_CACHE'''			,    str(A__			)			)
				monkeypatch.setattr('''datasets.config.HF_MODULES_CACHE'''			,    str(A__			)			)
				snake_case_						:   List[Any]           =  test_hf_datasets_cache / """downloads"""
				monkeypatch.setattr('''datasets.config.DOWNLOADED_DATASETS_PATH'''			,    str(A__			)			)
				snake_case_						:   str           =  test_hf_datasets_cache / """downloads""" / """extracted"""
				monkeypatch.setattr('''datasets.config.EXTRACTED_DATASETS_PATH'''			,    str(A__			)			)






@pytest.fixture(autouse=A__			,    scope='''session'''			)
def 					lowerCamelCase_						(    )		->						Dict:






				"""simple docstring"""


				datasets.disable_progress_bar()






@pytest.fixture(autouse=A__			)
def 					lowerCamelCase_						(    _UpperCamelCase			)		->						Optional[Any]:






				"""simple docstring"""


				monkeypatch.setattr('''datasets.config.HF_UPDATE_DOWNLOAD_COUNTS'''			,    A__			)






@pytest.fixture
def 					lowerCamelCase_						(    _UpperCamelCase			)		->						Tuple:






				"""simple docstring"""


				monkeypatch.setattr('''sqlalchemy.util.deprecations.SILENCE_UBER_WARNING'''			,    A__			)







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_						(    _UpperCamelCase			)		->						tuple:






				"""simple docstring"""


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






def 					lowerCamelCase_						(    _UpperCamelCase			,    _UpperCamelCase			)		->						XGBClassifier:






				"""simple docstring"""


				snake_case_						:   Optional[Any]           =  XGBClassifier()
				classifier.fit(_UpperCamelCase			,    _UpperCamelCase			)
				return classifier






def 					lowerCamelCase_						(    )		->						None:






				"""simple docstring"""


				snake_case_						:   Optional[Any]           =  load_iris()
				snake_case_      ,							snake_case_						:   str           =  data_handling(_UpperCamelCase			)
				snake_case_      ,							snake_case_      ,							snake_case_      ,							snake_case_						:   Dict           =  train_test_split(
				    _UpperCamelCase			,    _UpperCamelCase			,    test_size=0.25			)

				snake_case_						:   List[str]           =  iris['''target_names''']

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