Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best Fit In Python
#1
Hi all

I was wondering is anyone could give me some guidance on how to solve the following problem.

I have list of numbers that represent temperature (shown on the picture in blue).

After plotting the data the general trend of the number is more or less the same and then gradually increases linearly and then becomes more or less constant.

I have created a second plot to show the best fit trend of the values.

Is there any way of writing a program such that i would enter the existing values and Python would find the best fit orange line?

I just need some general ideas and push in the right direction thats all.

Thank you.

Attached Files

Thumbnail(s)
   
Reply
#2
SciPy's optimize module includes functions for least squares and curve fitting: https://docs.scipy.org/doc/scipy/referen...imize.html.
Reply
#3
Scikit-learn does a great job with regressions.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020