





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 							SCREAMING_SNAKE_CASE__  (			__a      ):
	return (data["data"], data["target"])


def 							SCREAMING_SNAKE_CASE__  (			__a      ,       __a      ):
	snake_case_						:	Dict      =		XGBClassifier()
	classifier.fit(_UpperCamelCase      ,       _UpperCamelCase      )
	return classifier


def 							SCREAMING_SNAKE_CASE__  (			):
	snake_case_						:	Tuple      =		load_iris()
	snake_case_						:	Union[str, Any]      =		data_handling(_UpperCamelCase      )
	snake_case_						:	Optional[Any]      =		train_test_split(
	    _UpperCamelCase      ,       _UpperCamelCase      ,       test_size=0.25      )

	snake_case_						:	Optional[Any]      =		iris['''target_names''']

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








from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
	if not (is_transformers_available() and is_torch_available() and is_transformers_version('''>=''', '''4.25.0''')):
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	from ...utils.dummy_torch_and_transformers_objects import UnCLIPImageVariationPipeline, UnCLIPPipeline
else:
	from .pipeline_unclip import UnCLIPPipeline
	from .pipeline_unclip_image_variation import UnCLIPImageVariationPipeline
	from .text_proj import UnCLIPTextProjModel
