xypnox / xyplot

Plotting with python made easy
GNU General Public License v2.0
8 stars 2 forks source link

Added a way to make linear regression #2

Open MuriloAndre2000 opened 5 years ago

MuriloAndre2000 commented 5 years ago

I added 2 new functions, one will estimate the coef that best fit a function and other tha plot such line in the curve

xypnox commented 5 years ago

Hi @MuriloAndre2000, I see that you have implemented the linear regression for the data. It is a great addition when people just want to get the linear curve fit. However, the same can be done by passing the degree of the polynomial as 1. Which will fit the data as well using regression.

What I actually had in mind while proposing the regression was for generic functions that could be made to fit the data if we knew the type of the function and a few parameters that needed to be found.

A great example of this procedure is http://scipy-lectures.org/intro/scipy/auto_examples/plot_curve_fit.html/

What we would like is to provide a seamless and intuitive way to plot these type of graphs. Currently the method involves importing a lot of things from different libraries and knowledge about what the functions return and how to plot it. We need to create an interface where the user just inputs the data and passes a function with variable parameters with the first one being the x coordinate. And our program plots the regression/curve fit automatically.

MuriloAndre2000 commented 5 years ago

ohhhh I got it, well, I will study and tonight I will make another commit

xypnox commented 4 years ago

@MuriloAndre2000 Can you please make the commit or should I close this PR?