'''simple docstring'''






import argparse
import datetime






def  UpperCamelCase__					(					_lowercase    :				str     )							->	str:
  __UpperCAmelCase:					Union[str, Any]		= {
      """0""": """Sunday""",
      """1""": """Monday""",
      """2""": """Tuesday""",
      """3""": """Wednesday""",
      """4""": """Thursday""",
      """5""": """Friday""",
      """6""": """Saturday""",
  }

  __UpperCAmelCase:					Tuple		= {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0}

  # Validate
  if not 0 < len(_lowercase     ) < 1_1:
    raise ValueError("""Must be 10 characters long"""     )

  # Get month
  __UpperCAmelCase:					int		= int(date_input[0] + date_input[1]     )
  # Validate
  if not 0 < m < 1_3:
    raise ValueError("""Month must be between 1 - 12"""     )

  __UpperCAmelCase:					str		= date_input[2]
  # Validate
  if sep_a not in ["-", "/"]:
    raise ValueError("""Date separator must be '-' or '/'"""     )

  # Get day
  __UpperCAmelCase:					int		= int(date_input[3] + date_input[4]     )
  # Validate
  if not 0 < d < 3_2:
    raise ValueError("""Date must be between 1 - 31"""     )

  # Get second separator
  __UpperCAmelCase:					str		= date_input[5]
  # Validate
  if sep_a not in ["-", "/"]:
    raise ValueError("""Date separator must be '-' or '/'"""     )

  # Get year
  __UpperCAmelCase:					int		= int(date_input[6] + date_input[7] + date_input[8] + date_input[9]     )
  # Arbitrary year range
  if not 4_5 < y < 8_5_0_0:
    raise ValueError(
        """Year out of range. There has to be some sort of limit...right?"""     )

  # Get datetime obj for validation
  __UpperCAmelCase:					str		= datetime.date(int(_lowercase     )   ,    int(_lowercase     )   ,    int(_lowercase     )     )

  # Start math
  if m <= 2:
    __UpperCAmelCase:					Any		= y - 1
    __UpperCAmelCase:					Optional[Any]		= m + 1_2
  # maths var
  __UpperCAmelCase:					int		= int(str(_lowercase     )[:2]     )
  __UpperCAmelCase:					int		= int(str(_lowercase     )[2:]     )
  __UpperCAmelCase:					int		= int(2.6 * m - 5.39     )
  __UpperCAmelCase:					int		= int(c / 4     )
  __UpperCAmelCase:					int		= int(k / 4     )
  __UpperCAmelCase:					int		= int(d + k     )
  __UpperCAmelCase:					int		= int(t + u + v + x     )
  __UpperCAmelCase:					int		= int(z - (2 * c)     )
  __UpperCAmelCase:					int		= round(w % 7     )
  # End math

  # Validate math
  if f != convert_datetime_days[dt_ck.weekday()]:
    raise AssertionError("""The date was evaluated incorrectly. Contact developer."""     )

  # Response
  __UpperCAmelCase:					str		= F'''Your date {date_input}, is a {days[str(_lowercase     )]}!'''
  return response


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    SCREAMING_SNAKE_CASE_     :   Any	   =			argparse.ArgumentParser(
        description=(
            'Find out what day of the week nearly any date is or was. Enter '
            'date as a string in the mm-dd-yyyy or mm/dd/yyyy format'
        )
    )
    parser.add_argument(
        'date_input', type=str, help='Date as a string (mm-dd-yyyy or mm/dd/yyyy)'
    )
    SCREAMING_SNAKE_CASE_     :   int	   =			parser.parse_args()
    zeller(args.date_input)
'''simple docstring'''






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_	   =			(((5_15, 22, 13), 5_55), ((61, 35, 49), 1_50))
SCREAMING_SNAKE_CASE_	   =			[2, 4, 1, 5]
SCREAMING_SNAKE_CASE_	   =			len(train_data)
SCREAMING_SNAKE_CASE_	   =			0.009






def  UpperCamelCase__					(					_lowercase    :				Union[str, Any]   ,    _lowercase    :				List[Any]="train"     )							->	int:
  return calculate_hypothesis_value(_lowercase   ,    _lowercase     ) - output(
      _lowercase   ,    _lowercase     )






def  UpperCamelCase__					(					_lowercase    :				Dict     )							->	Optional[Any]:
  __UpperCAmelCase:					List[Any]		= 0
  for i in range(len(_lowercase     ) - 1     ):
    hyp_val += data_input_tuple[i] * parameter_vector[i + 1]
  hyp_val += parameter_vector[0]
  return hyp_val






def  UpperCamelCase__					(					_lowercase    :				List[str]   ,    _lowercase    :				List[str]     )							->	Optional[Any]:
  if data_set == "train":
    return train_data[example_no][1]
  elif data_set == "test":
    return test_data[example_no][1]
  return None






def  UpperCamelCase__					(					_lowercase    :				Dict   ,    _lowercase    :				str     )							->	Dict:
  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__					(					_lowercase    :				Optional[int]   ,    _lowercase    :				Union[str, Any]=m     )							->	Optional[Any]:
  __UpperCAmelCase:					int		= 0
  for i in range(_lowercase     ):
    if index == -1:
      summation_value += _error(_lowercase     )
    else:
      summation_value += _error(_lowercase     ) * train_data[i][0][index]
  return summation_value






def  UpperCamelCase__					(					_lowercase    :				Tuple     )							->	Optional[int]:
  __UpperCAmelCase:					Any		= summation_of_cost_derivative(_lowercase   ,    _lowercase     ) / m
  return cost_derivative_value






def  UpperCamelCase__					(					)							->	Tuple:
  global parameter_vector
  # Tune these values to set a tolerance value for predicted output
  __UpperCAmelCase:					str		= 0.00_00_02
  __UpperCAmelCase:					List[Any]		= 0
  __UpperCAmelCase:					Optional[Any]		= 0
  while True:
    j += 1
    __UpperCAmelCase:					Any		= [0, 0, 0, 0]
    for i in range(0   ,    len(_lowercase     )     ):
      __UpperCAmelCase:					str		= get_cost_derivative(i - 1     )
      __UpperCAmelCase:					List[str]		= (
          parameter_vector[i] - LEARNING_RATE * cost_derivative
      )
    if numpy.allclose(
        _lowercase   ,    _lowercase   ,    atol=_lowercase   ,    rtol=_lowercase   ,    ):
      break
    __UpperCAmelCase:					List[Any]		= temp_parameter_vector
  print(("""Number of iterations:""", j)     )






def  UpperCamelCase__					(					)							->	Dict:
  for i in range(len(_lowercase     )     ):
    print(("""Actual output value:""", output(_lowercase   ,    """test"""     ))     )
    print(("""Hypothesis output:""", calculate_hypothesis_value(_lowercase   ,    """test"""     ))     )


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