In this link of the scikit-learn project: http://scikit-learn.org/stable/auto_examples/linear_model/plot_polynomial_interpolation.html, it is shown how to apply polynomial interpolation to approximate a certain function for example.
This example is set for 2D-points. However:
How can it be extended to fit for 3D-points?
Or is this even possible with scikit-learn? In the documentation I couldn't find any hints yet.
Thank you in advance for any information and with best regards.
Dan
Edit 1:
Thank you Robin for your answers! Also pointing out at the rapid growth of complexity was a valuable hint!
I've stumbled on one problem so far, which is related to the 2D-array X in model.fit(X,z)
The 2D-array looks like that:
[[ 0.1010101 0.35353535]
[ 0.4040404 0.65656566]
[ 0.80808081 1.11111111]
[ 1.21212121 1.31313131]]
while the function z is those of an paraboloid:
(((x**2)/(4**2) + ((y**2)/(8**2))) * 2)
Running model.fit(X,z)
returns the following error message:
ValueError: Found arrays with inconsistent numbers of samples: [10 20]
From where does the inconsistency results?