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

Function _error

machine_learning/gradient_descent.py:22–30  ·  view source on GitHub ↗

:param data_set: train data or test data :param example_no: example number whose error has to be checked :return: error in example pointed by example number.

(example_no, data_set="train")

Source from the content-addressed store, hash-verified

20
21
22def _error(example_no, data_set="train"):
23 """
24 :param data_set: train data or test data
25 :param example_no: example number whose error has to be checked
26 :return: error in example pointed by example number.
27 """
28 return calculate_hypothesis_value(example_no, data_set) - output(
29 example_no, data_set
30 )
31
32
33def _hypothesis_value(data_input_tuple):

Callers 1

Calls 2

outputFunction · 0.85

Tested by

no test coverage detected