I am reading data from a file using pandas
which looks like this:
data.head()
ldr1 ldr2 servo
0 971 956 -2
1 691 825 -105
2 841 963 -26
3 970 731 44
4 755 939 -69
I proceed to normalize this data to perform gradient descent:
my_data = (my_data - my_data.mean())/my_data.std()
my_data.head()
ldr1 ldr2 servo
0 1.419949 1.289668 0.366482
1 -0.242834 0.591311 -1.580420
2 0.647943 1.326984 -0.087165
3 1.414011 0.090200 1.235972
4 0.137231 1.199041 -0.899949
I perform multivariate regression and end up with fitted parameters on the normalized data:
Thetas: [[-3.86865143e-17, 8.47885685e-01, -5.39083511e-01]]
I would like to plot the plane of best fit on the original data and not the normalized data using the normalized thetas.
I used scipy.optimize.curve_fit
to perform multivariate linear regression and come up with the optimal fitted parameters. I know that the original thetas should be close to the following:
[ 0.26654135 -0.15218007 -107.79915373]
How can I get the 'original' thetas for the original data-set in order to plot, without using Scikit-Learn?
Any suggestions will be appreciated.