'''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__							)      ->       Optional[int]:
    return np.linalg.norm(np.array(UpperCamelCase__							) - np.array(UpperCamelCase__							)							)






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__=5							)      ->       str:
    __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'''




def __lowerCAmelCase					(				UpperCamelCase__							)      ->       float:
    __lowerCamelCase            =    0
    while len(UpperCamelCase__							) > 1:
        __lowerCamelCase            =    0
        # Consider two files with minimum cost to be merged
        for _ in range(2							):
            __lowerCamelCase            =    files.index(min(UpperCamelCase__							)							)
            temp += files[min_index]
            files.pop(UpperCamelCase__							)
        files.append(UpperCamelCase__							)
        optimal_merge_cost += temp
    return optimal_merge_cost


if __name__ == "__main__":
  import doctest

  doctest.testmod()
