


import os

snake_case    :   List[Any]	    =					{'''I''': 1, '''V''': 5, '''X''': 10, '''L''': 50, '''C''': 1_00, '''D''': 5_00, '''M''': 10_00}
def     __lowerCamelCase						(			UpperCAmelCase_						:		str						):




      """simple docstring"""





      a						:Dict										=	0

      a						:Optional[int]										=	0
      while index < len(UpperCAmelCase_						) - 1:
            a						:Union[str, Any]										=	SYMBOLS[numerals[index]]
            a						:Union[str, Any]										=	SYMBOLS[numerals[index + 1]]
            if current_value < next_value:
                  total_value -= current_value
            else:
                  total_value += current_value
            index += 1
      total_value += SYMBOLS[numerals[index]]

      return total_value
def     __lowerCamelCase						(			UpperCAmelCase_						:		int						):




      """simple docstring"""





      a						:Any										=	''''''

      a						:int										=	num // 1000
      numerals += m_count * "M"
      num %= 1000

      a						:Union[str, Any]										=	num // 100
      if c_count == 9:
            numerals += "CM"
            c_count -= 9
      elif c_count == 4:
            numerals += "CD"
            c_count -= 4
      if c_count >= 5:
            numerals += "D"
            c_count -= 5
      numerals += c_count * "C"
      num %= 100

      a						:str										=	num // 10
      if x_count == 9:
            numerals += "XC"
            x_count -= 9
      elif x_count == 4:
            numerals += "XL"
            x_count -= 4
      if x_count >= 5:
            numerals += "L"
            x_count -= 5
      numerals += x_count * "X"
      num %= 10

      if num == 9:
            numerals += "IX"
            num -= 9
      elif num == 4:
            numerals += "IV"
            num -= 4
      if num >= 5:
            numerals += "V"
            num -= 5
      numerals += num * "I"

      return numerals
def     __lowerCamelCase						(			UpperCAmelCase_						:		str = "/p089_roman.txt"						):




      """simple docstring"""





      a						:int										=	0

      with open(os.path.dirname(UpperCAmelCase_						) + roman_numerals_filename						) as filea:
            a						:Optional[int]										=	filea.readlines()

      for line in lines:
            a						:Dict										=	line.strip()
            a						:str										=	parse_roman_numerals(UpperCAmelCase_						)
            a						:Optional[Any]										=	generate_roman_numerals(UpperCAmelCase_						)
            savings += len(UpperCAmelCase_						) - len(UpperCAmelCase_						)

      return savings


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





