


'''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 __snake_case					(      UpperCAmelCase_						:						dict		):
 return (data["data"], data["target"])





def __snake_case					(      UpperCAmelCase_						:						np.ndarray					,				UpperCAmelCase_						:						np.ndarray		):
 lowerCamelCase_      =  XGBClassifier()
 classifier.fit(UpperCAmelCase_					,				UpperCAmelCase_		)
 return classifier





def __snake_case					(      ):
 lowerCamelCase_      =  load_iris()
 lowerCamelCase_ ,lowerCamelCase_      =  data_handling(UpperCAmelCase_		)
 lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_      =  train_test_split(
     UpperCAmelCase_					,				UpperCAmelCase_					,				test_size=0.25		)

 lowerCamelCase_      =  iris["target_names"]

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







'''simple docstring'''

import math





def __snake_case					(      UpperCAmelCase_						:						int		):
 lowerCamelCase_      =  math.loga(math.sqrt(4 * positive_integer + 1		) / 2 + 1 / 2		)

 return exponent == int(UpperCAmelCase_		)





def __snake_case					(      UpperCAmelCase_						:						float = 1 / 12345		):
 lowerCamelCase_      =  0
 lowerCamelCase_      =  0

 lowerCamelCase_      =  3
 while True:
  lowerCamelCase_      =  (integer**2 - 1) / 4
  # if candidate is an integer, then there is a partition for k
  if partition_candidate == int(UpperCAmelCase_		):
   lowerCamelCase_      =  int(UpperCAmelCase_		)
   total_partitions += 1
   if check_partition_perfect(UpperCAmelCase_		):
    perfect_partitions += 1
  if perfect_partitions > 0:
   if perfect_partitions / total_partitions < max_proportion:
    return int(UpperCAmelCase_		)
  integer += 1


if __name__ == "__main__":
     print(f'''{solution() = }''')



