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)
| 31 | |
| 32 | |
| 33 | def _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 | |
| 49 | def output(example_no, data_set): |
no outgoing calls
no test coverage detected