






def    UpperCAmelCase__	(						lowerCamelCase  : float						):
   return -num if num < 0 else num






def    UpperCAmelCase__	(						lowerCamelCase  : list[int]						):
   if len(lowerCamelCase						) == 0:
      raise ValueError("""abs_min() arg is an empty sequence"""						)
   lowerCamelCase											=x[0]
   for i in x:
      if abs_val(lowerCamelCase						) < abs_val(lowerCamelCase						):
         lowerCamelCase											=i
   return j






def    UpperCAmelCase__	(						lowerCamelCase  : list[int]						):
   if len(lowerCamelCase						) == 0:
      raise ValueError("""abs_max() arg is an empty sequence"""						)
   lowerCamelCase											=x[0]
   for i in x:
      if abs(lowerCamelCase						) > abs(lowerCamelCase						):
         lowerCamelCase											=i
   return j






def    UpperCAmelCase__	(						lowerCamelCase  : list[int]						):
   if len(lowerCamelCase						) == 0:
      raise ValueError("""abs_max_sort() arg is an empty sequence"""						)
   return sorted(lowerCamelCase ,key=lowerCamelCase						)[-1]






def    UpperCAmelCase__	(						):
   assert abs_val(0						) == 0
   assert abs_val(34						) == 34
   assert abs_val(-10_00_00_00_00_00						) == 10_00_00_00_00_00

   lowerCamelCase											=[-3, -1, 2, -11]
   assert abs_max(lowerCamelCase						) == -11
   assert abs_max_sort(lowerCamelCase						) == -11
   assert abs_min(lowerCamelCase						) == -1


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   test_abs_val()
   print(abs_val(-34))  # --> 34







from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier

# Load iris file
_UpperCAmelCase				:	Optional[int]    						=    load_iris()
iris.keys()


print(f"Target names: \n {iris.target_names} ")
print(f"\n Features: \n {iris.feature_names}")

# Train set e Test set
_UpperCAmelCase						,						_UpperCAmelCase						,						_UpperCAmelCase						,						_UpperCAmelCase				:	List[Any]    						=    train_test_split(
    iris['data'], iris['target'], random_state=4
)

# KNN

_UpperCAmelCase				:	Optional[int]    						=    KNeighborsClassifier(n_neighbors=1)
knn.fit(X_train, y_train)

# new array to test
_UpperCAmelCase				:	List[Any]    						=    [[1, 2, 1, 4], [2, 3, 4, 5]]

_UpperCAmelCase				:	Tuple    						=    knn.predict(X_new)

print(
    f"\nNew array: \n {X_new}\n\nTarget Names Prediction: \n"
    f" {iris['target_names'][prediction]}"
)