For a set of 20 bandwidth values, equally spaced between 0.01 and 1, fit a kernel regression to the training points and predict the regression function at the test x points. Evaluate its test error, measured in terms of squared error loss to the test y points. Hence, you will have a curve of 20 test errors; plot this test error curve. how should I write the code in R or python
the data:train data: https://easyupload.io/tcia0i test data: https://easyupload.io/crl7gp