MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / calculate_hypothesis_value

Function calculate_hypothesis_value

machine_learning/gradient_descent.py:62–73  ·  view source on GitHub ↗

Calculates hypothesis value for a given example :param data_set: test data or train_data :param example_no: example whose hypothesis value is to be calculated :return: hypothesis value for that example

(example_no, data_set)

Source from the content-addressed store, hash-verified

60
61
62def calculate_hypothesis_value(example_no, data_set):
63 """
64 Calculates hypothesis value for a given example
65 :param data_set: test data or train_data
66 :param example_no: example whose hypothesis value is to be calculated
67 :return: hypothesis value for that example
68 """
69 if data_set == "train":
70 return _hypothesis_value(train_data[example_no][0])
71 elif data_set == "test":
72 return _hypothesis_value(test_data[example_no][0])
73 return None
74
75
76def summation_of_cost_derivative(index, end=m):

Callers 2

_errorFunction · 0.85
test_gradient_descentFunction · 0.85

Calls 1

_hypothesis_valueFunction · 0.85

Tested by 1

test_gradient_descentFunction · 0.68