Data Science 🐍 Interpolation

preview_player
Показать описание
Interpolation constructs new prediction points from a discrete set of known data points. There are many types of interpolation such as nearest neighbor (piecewise constant), linear, polynomial, cubic spline, and basis spline. In interpolation, the data provide the shape of the approximate function, with piecewise or higher-order polynomial equations to exactly match the data points at those given discrete locations.

Course Modules
1. Data Science 🐍 Course Overview
2. Data Science 🐍 Import / Export
3. Data Science 🐍 Analyze
4. Data Science 🐍 Visualize
5. Data Science 🐍 Prepare Data
6. Data Science 🐍 Regression
7. Data Science 🐍 Features
8. Data Science 🐍 Classification
9. Data Science 🐍 Interpolation
10. Data Science 🐍 Solve Equations
11. Data Science 🐍 Differential Equations
12. Data Science 🐍 Time Series
Data Science 🐍 Final Project

Рекомендации по теме
Комментарии
Автор

Quick question: I tried plotting the cspline interpolated from 1.0/(1.0+25.0*x**2) over the range [-1.0, 0.5], but I ended up with 2 discontinuous splines, one from -1.0 to -0.5, another from -0.5 to 0.5. My understanding is cspline has continous 1st/2nd derivatives, so how was this possible? The relevant code is:
def f(x):
return 1.0/(1.0+25.0*x**2)
xr = np.array([-1.0, -0.8, -0.5, -0.25, -0.1, 0.1, 0.2, 0.5])
yr = f(xr)

c = GEKKO(remote=False)
c.options.IMODE = 2
xp = np.linspace(-1, 0.5, 100)
c.x = c.Param(value=xp)
c.y = c.Var()
c.cspline(c.x, c.y, xr, yr, True)
c.solve()


plt.plot(c.x, c.y, 'k--', label='Cubic Spline')

xToTaLBoReDoMx