

'''simple docstring'''

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

# Load iris file
lowercase__            =     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
lowercase__       ,    lowercase__       ,    lowercase__       ,    lowercase__            =     train_test_split(
    iris["data"], iris["target"], random_state=4
)

# KNN

lowercase__            =     KNeighborsClassifier(n_neighbors=1)
knn.fit(X_train, y_train)

# new array to test
lowercase__            =     [[1, 2, 1, 4], [2, 3, 4, 5]]

lowercase__            =     knn.predict(X_new)

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







'''simple docstring'''

from __future__ import annotations

from collections.abc import Callable




def  UpperCamelCase(	UpperCAmelCase_    ,			UpperCAmelCase_    ,			UpperCAmelCase_    ,			UpperCAmelCase_ = 1_00    ,			):
 UpperCAmelCase			:      Any		   =					x_start
 UpperCAmelCase			:      int		   =					fnc(UpperCAmelCase_      )
 UpperCAmelCase			:      str		   =					0.0

 for _ in range(UpperCAmelCase_      ):
  # Approximates small segments of curve as linear and solve
  # for trapezoidal area
  UpperCAmelCase			:      List[Any]		   =					(x_end - x_start) / steps + xa
  UpperCAmelCase			:      int		   =					fnc(UpperCAmelCase_      )
  area += abs(fxa + fxa      ) * (xa - xa) / 2

  # Increment step
  UpperCAmelCase			:      List[str]		   =					xa
  UpperCAmelCase			:      List[Any]		   =					fxa
 return area


if __name__ == "__main__":




 def  UpperCamelCase(	UpperCAmelCase_      ):
  return x**3

 print("f(x) = x^3")
 print("The area between the curve, x = -10, x = 10 and the x axis is:")
 lowercase__            =     10
 while i <= 100000:
  lowercase__            =     trapezoidal_area(f, -5, 5, i)
  print(f'''with {i} steps: {area}''')
  i *= 10




