

'''simple docstring'''





import math


class SCREAMING_SNAKE_CASE  :






			"""simple docstring"""




			def 			__lowerCAmelCase (    self ,				__UpperCamelCase ,				__UpperCamelCase							):

				"""simple docstring"""


				snake_case_      		= 0.0
				snake_case_      		= 0.0
				for i in range(len(__UpperCamelCase							)							):
					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 			__lowerCAmelCase (    self ,				__UpperCamelCase ,				__UpperCamelCase ,				__UpperCamelCase ,				__UpperCamelCase							):

				"""simple docstring"""


				for i in range(len(__UpperCamelCase							)							):
					weights[j][i] += alpha * (sample[i] - weights[j][i])
				return weights







def a():





	'''simple docstring'''
	snake_case_      		= [[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

	# weight initialization ( n, C )
	snake_case_      		= [[0.2, 0.6, 0.5, 0.9], [0.8, 0.4, 0.7, 0.3]]

	# training
	snake_case_      		= SelfOrganizingMap()
	snake_case_      		= 3
	snake_case_      		= 0.5

	for _ in range(lowercase__	):
		for j in range(len(lowercase__	)	):
			# training sample
			snake_case_      		= training_samples[j]

			# Compute the winning vector
			snake_case_      		= self_organizing_map.get_winner(lowercase__			, lowercase__	)

			# Update the winning vector
			snake_case_      		= self_organizing_map.update(lowercase__			, lowercase__			, lowercase__			, lowercase__	)

    # classify test sample
	snake_case_      		= [0, 0, 0, 1]
	snake_case_      		= self_organizing_map.get_winner(lowercase__			, lowercase__	)

	# 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 a(lowercase__			, lowercase__	):





	'''simple docstring'''
	if not isinstance(lowercase__			, lowercase__	):
		raise ValueError('iterations must be defined as integers'	)
	if not isinstance(lowercase__			, lowercase__	) or not number >= 1:
		raise ValueError(
		    'starting number must be\n                         and integer and be more than 0'	)
	if not iterations >= 1:
		raise ValueError('Iterations must be done more than 0 times to play FizzBuzz'	)

	snake_case_      		= ''
	while number <= iterations:
		if number % 3 == 0:
			out += "Fizz"
		if number % 5 == 0:
			out += "Buzz"
		if 0 not in (number % 3, number % 5):
			out += str(lowercase__	)

		# print(out)
		number += 1
		out += " "
	return out


if __name__ == "__main__":
		import doctest

		doctest.testmod()
