


'''simple docstring'''

def __snake_case      (   UpperCAmelCase_		:		list[int]	):
 if not numbers:
  return 0

 if not isinstance(UpperCAmelCase_      ,       (list, tuple)	) or not all(
     isinstance(UpperCAmelCase_      ,       UpperCAmelCase_	) for number in numbers	):
  raise ValueError("numbers must be an iterable of integers"	)

 lowerCamelCase_  				=						lowerCamelCase_  				=						lowerCamelCase_  				=						numbers[0]

 for i in range(1      ,       len(UpperCAmelCase_	)	):
  # update the maximum and minimum subarray products
  lowerCamelCase_  				=						numbers[i]
  if number < 0:
   lowerCamelCase_				,lowerCamelCase_  				=						min_till_now, max_till_now
  lowerCamelCase_  				=						max(UpperCAmelCase_      ,       max_till_now * number	)
  lowerCamelCase_  				=						min(UpperCAmelCase_      ,       min_till_now * number	)

  # update the maximum product found till now
  lowerCamelCase_  				=						max(UpperCAmelCase_      ,       UpperCAmelCase_	)

 return max_prod







'''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()



