


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



						"""simple docstring"""




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




def 	lowerCamelCase_							(       UpperCAmelCase__							,     UpperCAmelCase__   ):



						"""simple docstring"""




						a_		      =		XGBClassifier()
						classifier.fit(SCREAMING_SNAKE_CASE_							,     SCREAMING_SNAKE_CASE_   )
						return classifier




def 	lowerCamelCase_							(       ):



						"""simple docstring"""




						a_		      =		load_iris()
						a_      , a_		      =		data_handling(SCREAMING_SNAKE_CASE_   )
						a_      , a_      , a_      , a_		      =		train_test_split(
						    SCREAMING_SNAKE_CASE_							,     SCREAMING_SNAKE_CASE_							,     test_size=0.25   )

						a_		      =		iris["""target_names"""]

						# Create an XGBoost Classifier from the training data
						a_		      =		xgboost(SCREAMING_SNAKE_CASE_							,     SCREAMING_SNAKE_CASE_   )

						# Display the confusion matrix of the classifier with both training and test sets
						ConfusionMatrixDisplay.from_estimator(
						    SCREAMING_SNAKE_CASE_							,     SCREAMING_SNAKE_CASE_							,     SCREAMING_SNAKE_CASE_							,     display_labels=SCREAMING_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'''
from PIL import Image





def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_       ,SCREAMING_SNAKE_CASE_     )		->		Image:

			def brightness(SCREAMING_SNAKE_CASE_     ) -> float:
						return 128 + level + (c - 128)

			if not -255.0 <= level <= 255.0:
						raise ValueError('level must be between -255.0 (black) and 255.0 (white)'     )
			return img.point(SCREAMING_SNAKE_CASE_     )


if __name__ == "__main__":
							# Load image
							with Image.open("image_data/lena.jpg") as img:
														# Change brightness to 100
														_SCREAMING_SNAKE_CASE			=						change_brightness(img, 1_00)
														brigt_img.save("image_data/lena_brightness.png", format="png")




