

import math



class        A__:
						"""simple docstring"""






						def 			UpperCamelCase__					(    self  ,      _lowercase  ,      _lowercase    )     -> int:
									a_						:						Tuple 							= 0.0
									a_						:						int 							= 0.0
									for i in range(len(_lowercase    )    ):
												da += math.pow((sample[i] - weights[0][i])  ,      2    )
												da += math.pow((sample[i] - weights[1][i])  ,      2    )
												return 0 if da > da else 1
									return 0





						def 			UpperCamelCase__					(    self  ,      _lowercase  ,      _lowercase  ,      _lowercase  ,      _lowercase    )     -> list[list[int | float]]:
									for i in range(len(_lowercase    )    ):
												weights[j][i] += alpha * (sample[i] - weights[j][i])
									return weights







def 					_UpperCAmelCase				(						):

			'''simple docstring'''



			a_						:						Optional[int] 							= [[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

			# weight initialization ( n, C )
			a_						:						Optional[int] 							= [[0.2, 0.6, 0.5, 0.9], [0.8, 0.4, 0.7, 0.3]]

			# training
			a_						:						Tuple 							= SelfOrganizingMap()
			a_						:						str 							= 3
			a_						:						Union[str, Any] 							= 0.5

			for _ in range(a__):
						for j in range(len(a__)):
									# training sample
									a_						:						Optional[int] 							= training_samples[j]

									# Compute the winning vector
									a_						:						str 							= self_organizing_map.get_winner(a__  ,	a__)

									# Update the winning vector
									a_						:						str 							= self_organizing_map.update(a__  ,	a__  ,	a__  ,	a__)

    # classify test sample
			a_						:						int 							= [0, 0, 0, 1]
			a_						:						str 							= self_organizing_map.get_winner(a__  ,	a__)

			# results
			print(f'''Clusters that the test sample belongs to : {winner}''')
			print(f'''Weights that have been trained : {weights}''')


# running the main() function
if __name__ == "__main__":
	main()





def 					_UpperCAmelCase				(						a__  ,	a__):

			'''simple docstring'''



			return x if y == 0 else greatest_common_divisor(a__  ,	x % y)


def 					_UpperCAmelCase				(						a__  ,	a__):

			'''simple docstring'''



			return (x * y) // greatest_common_divisor(a__  ,	a__)


def 					_UpperCAmelCase				(						a__ = 2_0):

			'''simple docstring'''



			a_						:						Any 							= 1
			for i in range(1  ,	n + 1):
						a_						:						Tuple 							= lcm(a__  ,	a__)
			return g


if __name__ == "__main__":
	print(F"""{solution() = }""")


