






import numpy

# List of input, output pairs
SCREAMING_SNAKE_CASE__				     =			(
    ((5, 2, 3), 15),
    ((6, 5, 9), 25),
    ((11, 12, 13), 41),
    ((1, 1, 1), 8),
    ((11, 12, 13), 41),
)
SCREAMING_SNAKE_CASE__				     =			(((515, 22, 13), 555), ((61, 35, 49), 150))
SCREAMING_SNAKE_CASE__				     =			[2, 4, 1, 5]
SCREAMING_SNAKE_CASE__				     =			len(train_data)
SCREAMING_SNAKE_CASE__				     =			0.0_0_9

def        UpperCAmelCase__		(						lowerCamelCase_       :       Union[str, Any]   ,  lowerCamelCase_       :       Dict="train"				):
			return calculate_hypothesis_value(lowerCamelCase_   ,  lowerCamelCase_				) - output(
			    lowerCamelCase_   ,  lowerCamelCase_				)

def        UpperCAmelCase__		(						lowerCamelCase_       :       Optional[int]				):
			__a						:  List[Any]									=     0
			for i in range(len(lowerCamelCase_				) - 1				):
						hyp_val += data_input_tuple[i] * parameter_vector[i + 1]
			hyp_val += parameter_vector[0]
			return hyp_val

def        UpperCAmelCase__		(						lowerCamelCase_       :       Optional[Any]   ,  lowerCamelCase_       :       Optional[int]				):
			if data_set == "train":
						return train_data[example_no][1]
			elif data_set == "test":
						return test_data[example_no][1]
			return None

def        UpperCAmelCase__		(						lowerCamelCase_       :       List[Any]   ,  lowerCamelCase_       :       Optional[Any]				):
			if data_set == "train":
						return _hypothesis_value(train_data[example_no][0]				)
			elif data_set == "test":
						return _hypothesis_value(test_data[example_no][0]				)
			return None

def        UpperCAmelCase__		(						lowerCamelCase_       :       Optional[int]   ,  lowerCamelCase_       :       Optional[int]=m				):
			__a						:  Optional[Any]									=     0
			for i in range(lowerCamelCase_				):
						if index == -1:
									summation_value += _error(lowerCamelCase_				)
						else:
									summation_value += _error(lowerCamelCase_				) * train_data[i][0][index]
			return summation_value

def        UpperCAmelCase__		(						lowerCamelCase_       :       Optional[Any]				):
			__a						:  Union[str, Any]									=     summation_of_cost_derivative(lowerCamelCase_   ,  lowerCamelCase_				) / m
			return cost_derivative_value

def        UpperCAmelCase__		(						):
			global parameter_vector
			# Tune these values to set a tolerance value for predicted output
			__a						:  List[str]									=     0.000002
			__a						:  str									=     0
			__a						:  List[str]									=     0
			while True:
						j += 1
						__a						:  Dict									=     [0, 0, 0, 0]
						for i in range(0   ,  len(lowerCamelCase_				)				):
									__a						:  List[Any]									=     get_cost_derivative(i - 1				)
									__a						:  Dict									=     (
									    parameter_vector[i] - LEARNING_RATE * cost_derivative
									)
						if numpy.allclose(
						    lowerCamelCase_   ,  lowerCamelCase_   ,  atol=lowerCamelCase_   ,  rtol=lowerCamelCase_   ,  ):
									break
						__a						:  Dict									=     temp_parameter_vector
			print(('Number of iterations:', j)				)

def        UpperCAmelCase__		(						):
			for i in range(len(lowerCamelCase_				)				):
						print(('Actual output value:', output(lowerCamelCase_   ,  'test'				))				)
						print(('Hypothesis output:', calculate_hypothesis_value(lowerCamelCase_   ,  'test'				))				)


if __name__ == "__main__":
							run_gradient_descent()
							print('''\nTesting gradient descent for a linear hypothesis function.\n''')
							test_gradient_descent()













def 				__lowerCamelCase     (							__lowerCAmelCase							:					str							)     ->  bool:
   if not all(x.isalpha() for x in string							):
      raise ValueError("""String must only contain alphabetic characters."""							)

   __UpperCamelCase	:			List[str]					=					sorted(string.lower()							)
   return len(__lowerCAmelCase							) == len(set(__lowerCAmelCase							)							)


if __name__ == "__main__":
       UpperCamelCase    							=      input('Enter a string ').strip()

       UpperCamelCase    							=      is_isogram(input_str)
       print(F"""{input_str} is {'an' if isogram else 'not an'} isogram.""")



