'''simple docstring'''




from collections import Counter

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

__UpperCAmelCase     							=datasets.load_iris()

__UpperCAmelCase     							=np.array(data["data"])
__UpperCAmelCase     							=np.array(data["target"])
__UpperCAmelCase     							=data["target_names"]

__UpperCAmelCase							,       __UpperCAmelCase							,       __UpperCAmelCase							,       __UpperCAmelCase     							=train_test_split(X, y)






def __lowerCAmelCase (							UpperCamelCase__				,  UpperCamelCase__				)	->    Tuple:
    return np.linalg.norm(np.array(UpperCamelCase__				) - np.array(UpperCamelCase__				)				)






def __lowerCAmelCase (							UpperCamelCase__				,  UpperCamelCase__				,  UpperCamelCase__				,  UpperCamelCase__				,  UpperCamelCase__=5				)	->    int:
    __lowerCamelCase		=  zip(UpperCamelCase__				,  UpperCamelCase__				)
    # List of distances of all points from the point to be classified
    __lowerCamelCase		=  []
    for data_point in data:
        __lowerCamelCase		=  euclidean_distance(data_point[0]				,  UpperCamelCase__				)
        distances.append((distance, data_point[1])				)
    # Choosing 'k' points with the least distances.
    __lowerCamelCase		=  [i[1] for i in sorted(UpperCamelCase__				)[:k]]
    # Most commonly occurring class among them
    # is the class into which the point is classified
    __lowerCamelCase		=  Counter(UpperCamelCase__				).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"""


class 					snake_case		:


   '''simple docstring'''

   def __init__(	self :     List[str],       _lowerCamelCase :     list[int]  ):

     '''simple docstring'''
     __A									= len(_lowerCamelCase  )
     __A									= [0] * len_array

     if len_array > 0:
       __A									= array[0]

     for i in range(1,       _lowerCamelCase  ):
       __A									= self.prefix_sum[i - 1] + array[i]


   def 				_SCREAMING_SNAKE_CASE				(	self :     List[Any],       _lowerCamelCase :     int,       _lowerCamelCase :     int  ):

     '''simple docstring'''
     if start == 0:
       return self.prefix_sum[end]

     return self.prefix_sum[end] - self.prefix_sum[start - 1]






   def 				_SCREAMING_SNAKE_CASE				(	self :     List[str],       _lowerCamelCase :     int  ):

     '''simple docstring'''
     __A									= {0}
     for sum_item in self.prefix_sum:
       if sum_item - target_sum in sums:
         return True

       sums.add(_lowerCamelCase  )

     return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()




