Approximating scattered data

beliavsky at beliavsky at
Sun Jan 2 01:02:05 CET 2005

Grant Edwards wrote:
>I've been looking for some way to approximate scattered 3D data
>points in Python. The data doesn't seem to be amenable to
>fitting functions like polymials, so I may have to use
>something more like a spline surface.

>However, I can't find anything usable from Python, and my
>Fortram skills are pretty rusty. I tried SciPy, but it's spline
>fitting module doesn't work at all for my data. I've found
>mentions of a Python port NURBS toolbox, but all the links I
>can find are broken.

NURBS is available in Matlab and Scilab at , and translating to Python with
Numeric/Numarray should not be too hard.

If you are trying to fit z = f(x,y) without having a particular
functional form in mind, you can apply a nonparametric regression
technique. One of the easiest approaches to code is Nadaraya-Watson
kernel regression -- see for example ,
equation 4.68, where a Gaussian kernel can be used for K. PyML at may implement
this (I have not tried it). LIBSVM at has a Python interface for
Support Vector Machines, a fairly popular and recent flexible
regression method.

More information about the Python-list mailing list