'''simple docstring'''


from collections import Counter

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

__lowerCAmelCase	:       Optional[int]						       =	datasets.load_iris()

__lowerCAmelCase	:       Optional[int]						       =	np.array(data["data"])
__lowerCAmelCase	:       int						       =	np.array(data["target"])
__lowerCAmelCase	:       Dict						       =	data["""target_names"""]

__lowerCAmelCase	:       List[str]						       =	train_test_split(X, y)





def       lowerCAmelCase					(		UpperCamelCase__				:   int    ,					UpperCamelCase__				:   Optional[Any]       ):


	"""simple docstring"""
	return np.linalg.norm(np.array(UpperCamelCase__       ) - np.array(UpperCamelCase__       )       )





def       lowerCAmelCase					(		UpperCamelCase__				:   Tuple    ,					UpperCamelCase__				:   Optional[Any]    ,					UpperCamelCase__				:   List[Any]    ,					UpperCamelCase__				:   Optional[int]    ,					UpperCamelCase__				:   Dict=5       ):


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


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_speech_available, is_torch_available


__lowerCAmelCase	:       List[Any]						       =	{
    "configuration_audio_spectrogram_transformer": [
        "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "ASTConfig",
    ]
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase	:       str						       =	[
					    "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "ASTForAudioClassification",
					    "ASTModel",
					    "ASTPreTrainedModel",
					]

try:
					if not is_speech_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase	:       Union[str, Any]						       =	["ASTFeatureExtractor"]

if TYPE_CHECKING:
					from .configuration_audio_spectrogram_transformer import (
					    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    ASTConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_audio_spectrogram_transformer import (
										    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    ASTForAudioClassification,
										    ASTModel,
										    ASTPreTrainedModel,
										)

					try:
										if not is_speech_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
					import sys

					__lowerCAmelCase	:       Optional[Any]						       =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
