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