


from __future__ import annotations

from math import ceil, floor, sqrt
def     __lowerCamelCase						(			UpperCAmelCase_						:		int = 200_0000						):




      """simple docstring"""





      a						:Tuple										=	[0]
      a						:str										=	42

      for idx in range(1			,  ceil(sqrt(target * 2						) * 1.1						)						):
            triangle_numbers.append(triangle_numbers[-1] + idx						)

      # we want this to be as close as possible to target
      a						:Optional[int]										=	0
      # the area corresponding to the grid that gives the product closest to target
      a						:str										=	0
      # an estimate of b, using the quadratic formula
      a						:Optional[Any]										=	42
      # the largest integer less than b_estimate
      a						:Tuple										=	42
      # the largest integer less than b_estimate
      a						:Union[str, Any]										=	42
      # the triangle number corresponding to b_floor
      a						:Optional[int]										=	42
      # the triangle number corresponding to b_ceil
      a						:Dict										=	42

      for idx_a, triangle_a in enumerate(triangle_numbers[1:]			,  1						):
            a						:int										=	(-1 + sqrt(1 + 8 * target / triangle_a						)) / 2
            a						:Optional[int]										=	floor(UpperCAmelCase_						)
            a						:Dict										=	ceil(UpperCAmelCase_						)
            a						:Union[str, Any]										=	triangle_numbers[b_floor]
            a						:Optional[int]										=	triangle_numbers[b_ceil]

            if abs(target - triangle_b_first_guess * triangle_a						) < abs(
                target - best_product						):
                  a						:List[Any]										=	triangle_b_first_guess * triangle_a
                  a						:Optional[int]										=	idx_a * b_floor

            if abs(target - triangle_b_second_guess * triangle_a						) < abs(
                target - best_product						):
                  a						:Any										=	triangle_b_second_guess * triangle_a
                  a						:List[Any]										=	idx_a * b_ceil

      return area


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









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_						:		dict						):




      """simple docstring"""





      return (data["data"], data["target"])
def     __lowerCamelCase						(			UpperCAmelCase_						:		np.ndarray			,  UpperCAmelCase_						:		np.ndarray						):




      """simple docstring"""





      a						:Optional[Any]										=	XGBClassifier()
      classifier.fit(UpperCAmelCase_			,  UpperCAmelCase_						)
      return classifier
def     __lowerCamelCase						(			):




      """simple docstring"""





      a						:List[Any]										=	load_iris()
      a							,    a						:Any										=	data_handling(UpperCAmelCase_						)
      a							,    a							,    a							,    a						:Tuple										=	train_test_split(
          UpperCAmelCase_			,  UpperCAmelCase_			,  test_size=0.25						)

      a						:List[Any]										=	iris['''target_names''']

      # Create an XGBoost Classifier from the training data
      a						:Optional[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()





