Large Dataset Polynomial Fitting Using Numpy

后端 未结 2 1005
半阙折子戏
半阙折子戏 2020-11-30 15:47

I\'m trying to fit a second order polynomial to raw data and output the results using Matplotlib. There are about a million points in the data set that I\'m trying to fit.

2条回答
  •  萌比男神i
    2020-11-30 16:15

    The problem is probably using a power basis for data that is displaced some distance from zero along the x axis. If you use the Polynomial class from numpy.polynomial it will scale and shift the data before the fit, which will help, and also keep track of the scale and shift used. Note that if you want the coefficients in the normal form you will need to convert to that form.

提交回复
热议问题