1
I am running a job in college and would like to implement a function that calculates a regressão linear
. Given the points and the number of exponents desired, I want to return the coefficients of the equation. For example, given the points below, and stating that I want only one exponent, I would like you to return the coefficients a
and b
of the first degree equation.
>>> x = [0.4, 0.6, 0.8, 1.4]
>>> y = [1.4, 2.1, 3.5, 6.7]
Any idea?
Lucas, I would like to implement a method and not use a ready one. I already knew this method mentioned, but I would like to implement some linear regression algorithm.
– Leo Ribeiro