https://github.com/lazyprogrammer/machine_learning_examples/blob/4deacdedb4c21ba2f708d19eee2d04bebc5208ce/linear_regression_class/lr_1d.py#L55