Code

Nadaraya-Watson Synthetic Data Generation Code

To practically demonstrate Nadaraya-Watson estimation, synthetic training data is generated based on a predefined non-linear dependency. By defining the true mathematical function f(x)=2sin(x)+xf(x) = 2\sin(x) + x, a set of 4040 training examples is computationally created by randomly sampling xx values and adding standard normal noise (ϵ\epsilon) to the outputs, resulting in a noisy dataset suitable for regression.

0

1

Updated 2026-05-14

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L