"""simple docstring"""






from collections import Counter

import numpy as np
from sklearn import datasets
from sklearn.model_selection import train_test_split

__lowerCAmelCase					: List[str]        =datasets.load_iris()

__lowerCAmelCase					: Dict        =np.array(data["""data"""])
__lowerCAmelCase					: str        =np.array(data["""target"""])
__lowerCAmelCase					: Any        =data["""target_names"""]

__lowerCAmelCase  ,  __lowerCAmelCase  ,  __lowerCAmelCase  ,  __lowerCAmelCase					: Any        =train_test_split(X, y)


def     UpperCAmelCase__ (       lowerCAmelCase__  :int      ,	lowerCAmelCase__  :str	)				->					Optional[Any]:
      '''simple docstring'''


      return np.linalg.norm(np.array(lowerCAmelCase__	) - np.array(lowerCAmelCase__	)	)


def     UpperCAmelCase__ (       lowerCAmelCase__  :int      ,	lowerCAmelCase__  :List[Any]      ,	lowerCAmelCase__  :Any      ,	lowerCAmelCase__  :List[str]      ,	lowerCAmelCase__  :Optional[Any]=5	)				->					Union[str, Any]:
      '''simple docstring'''


      lowercase														=			zip(lowerCAmelCase__      ,	lowerCAmelCase__	)
      # List of distances of all points from the point to be classified
      lowercase														=			[]
      for data_point in data:
            lowercase														=			euclidean_distance(data_point[0]      ,	lowerCAmelCase__	)
            distances.append((distance, data_point[1])	)
      # Choosing 'k' points with the least distances.
      lowercase														=			[i[1] for i in sorted(lowerCAmelCase__	)[:k]]
      # Most commonly occurring class among them
      # is the class into which the point is classified
      lowercase														=			Counter(lowerCAmelCase__	).most_common(1	)[0][0]
      return classes[result]


if __name__ == "__main__":
       print(classifier(X_train, y_train, classes, [4.4, 3.1, 1.3, 1.4]))




"""simple docstring"""






from __future__ import annotations


def     UpperCAmelCase__ (       lowerCAmelCase__  :list[float]      ,	lowerCAmelCase__  :list[float]	)				->					float:
      '''simple docstring'''


      lowercase														=			sorted(numsa + numsa	)
      lowercase							,							lowercase														=			divmod(len(lowerCAmelCase__	)      ,	2	)
      if mod == 1:
            return all_numbers[div]
      else:
            return (all_numbers[div] + all_numbers[div - 1]) / 2


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       __lowerCAmelCase					: List[Any]        =[float(x) for x in input("""Enter the elements of first array: """).split()]
       __lowerCAmelCase					: List[Any]        =[float(x) for x in input("""Enter the elements of second array: """).split()]
       print(F"""The median of two arrays is: {median_of_two_arrays(array_a, array_a)}""")



