# How can I implement univariate Nadaraya-Watson regression for prediction？

How can I implement univariate Nadaraya-Watson regression for prediction？ And what is the $$x ,x_i$$, and $$y_i$$? How can I select the $$x ,x_i$$, and $$y_i$$？ The sample for prediction and the shape of sample is like $$[12,34,5,23]$$.It is a list.

$$\hat{m}_n(x) = \sum_{i=1}^n \frac{K\left( \frac{x-x_i}{h}\right)Y_i}{\sum_{j=1}^n K \left( \frac{x-x_j}{h}\right)}$$

$$(x_i,y_i)$$ are the training data set.
$$x$$ is the new point that you want to make prediction at that value. In your case, $$x$$ takes value from $$[12, 34, 5, 23]$$.