



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

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

# KNN

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

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

__A       =knn.predict(X_new)

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










class 						UpperCAmelCase__     :




			'''simple docstring'''






			def __init__(  self				:					List[Any]			,			a_				:					int					):
					'''simple docstring'''





					__UpperCAmelCase       :	List[Any]						=      data
					__UpperCAmelCase       :	BinaryTreeNode | None						=      None
					__UpperCAmelCase       :	BinaryTreeNode | None						=      None

def 			a		( _UpperCAmelCase				:   BinaryTreeNode | None					,  _UpperCAmelCase				:   int		):







		'''simple docstring'''





		if node is None:
				__UpperCAmelCase       :	List[Any]						=      BinaryTreeNode(_UpperCAmelCase		)
				return node

		# binary search tree is not empty,
		# so we will insert it into the tree
		# if new_value is less than value of data in node,
		#  add it to left subtree and proceed recursively
		if new_value < node.data:
				__UpperCAmelCase       :	int						=      insert(node.left_child					,  _UpperCAmelCase		)
		else:
				# if new_value is greater than value of data in node,
				#  add it to right subtree and proceed recursively
				__UpperCAmelCase       :	str						=      insert(node.right_child					,  _UpperCAmelCase		)
		return node

def 			a		( _UpperCAmelCase				:   None | BinaryTreeNode		):  # if node is None,return







		'''simple docstring'''





		if node:
				__UpperCAmelCase       :	Optional[int]						=      inorder(node.left_child		)
				__UpperCAmelCase       :	int						=      [*inorder_array, node.data]
				__UpperCAmelCase       :	Optional[Any]						=      inorder_array + inorder(node.right_child		)
		else:
				__UpperCAmelCase       :	List[Any]						=      []
		return inorder_array

def 			a		( ):







		'''simple docstring'''





		__UpperCAmelCase       :	Any						=      insert(_UpperCAmelCase					,  15		)
		insert(_UpperCAmelCase					,  10		)
		insert(_UpperCAmelCase					,  25		)
		insert(_UpperCAmelCase					,  6		)
		insert(_UpperCAmelCase					,  14		)
		insert(_UpperCAmelCase					,  20		)
		insert(_UpperCAmelCase					,  60		)
		return root

def 			a		( ):







		'''simple docstring'''





		__UpperCAmelCase       :	List[Any]						=      make_tree()
		print('''Printing values of binary search tree in Inorder Traversal.'''		)
		inorder(_UpperCAmelCase		)


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				main()





