"""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 SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase )  ->  tuple:
   return (data["data"], data["target"])



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase       ,    __UpperCAmelCase )  ->  XGBClassifier:
   lowercase__:   List[Any]					=      XGBClassifier()
   classifier.fit(__UpperCAmelCase       ,    __UpperCAmelCase )
   return classifier



def SCREAMING_SNAKE_CASE__			(   )  ->  None:
   lowercase__:   Optional[int]					=      load_iris()
   lowercase__, lowercase__:   int					=      data_handling(__UpperCAmelCase )
   lowercase__, lowercase__, lowercase__, lowercase__:   Dict					=      train_test_split(
       __UpperCAmelCase       ,    __UpperCAmelCase       ,    test_size=0.2_5 )

   lowercase__:   Dict					=      iris['''target_names''']

   # Create an XGBoost Classifier from the training data
   lowercase__:   List[Any]					=      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"""






from __future__ import annotations

from math import pi, sqrt



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase       ,    __UpperCAmelCase )  ->  tuple:

   if inductance <= 0:
      raise ValueError('''Inductance cannot be 0 or negative''' )

   elif capacitance <= 0:
      raise ValueError('''Capacitance cannot be 0 or negative''' )

   else:
      return (
          "Resonant frequency",
          float(1 / (2 * pi * (sqrt(inductance * capacitance ))) ),
      )


if __name__ == "__main__":
       import doctest

       doctest.testmod()
