

.. _example_neighbors_plot_regression.py:


============================
Nearest Neighbors regression
============================

Demonstrate the resolution of a regression problem
using a k-Nearest Neighbor and the interpolation of the
target using both barycenter and constant weights.




.. image:: images/plot_regression_1.png
    :align: center




**Python source code:** :download:`plot_regression.py <plot_regression.py>`

.. literalinclude:: plot_regression.py
    :lines: 11-
    