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

Function _hypothesis_value

machine_learning/gradient_descent.py:33–46  ·  view source on GitHub ↗

Calculates hypothesis function value for a given input :param data_input_tuple: Input tuple of a particular example :return: Value of hypothesis function at that point. Note that there is an 'biased input' whose value is fixed as 1. It is not explicitly mentioned in input data..

(data_input_tuple)

Source from the content-addressed store, hash-verified

31
32
33def _hypothesis_value(data_input_tuple):
34 """
35 Calculates hypothesis function value for a given input
36 :param data_input_tuple: Input tuple of a particular example
37 :return: Value of hypothesis function at that point.
38 Note that there is an 'biased input' whose value is fixed as 1.
39 It is not explicitly mentioned in input data.. But, ML hypothesis functions use it.
40 So, we have to take care of it separately. Line 36 takes care of it.
41 """
42 hyp_val = 0
43 for i in range(len(parameter_vector) - 1):
44 hyp_val += data_input_tuple[i] * parameter_vector[i + 1]
45 hyp_val += parameter_vector[0]
46 return hyp_val
47
48
49def output(example_no, data_set):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected