Interpolation is a method of estimating unknown data points in a given range. Spline interpolation is a type of piecewise polynomial interpolation method. Spline interpolation is a useful method in smoothing the curve or surface data.

In my previous posts, I explained how to implement spline interpolation and B-spline curve fitting in Python. We can apply the spline smoothing method to scattered data. In this tutorial, you'll learn how to fit scattered data by using spline functions in Python.

The tutorial covers,

- Preparing test data
- Spline curve fitting
- Fitting on various knots number

We'll start by loading the required libraries for this tutorial.

` `

```
from sklearn.datasets import load_boston
from scipy import interpolate
import matplotlib.pyplot as plt
import numpy as np
```

` `