← Back to all experiments
RegressionIntermediateLocally Weighted Regression

Locally Weighted Regression

Fits non-parametric curves with varying bandwidth values.

Key highlights

  • Uses Gaussian kernel weighting
  • Compares multiple tau values
  • Smooth non-linear fits

Metrics

Bandwidth sensitivity

Dataset

Synthetic

Outputs

Locally weighted regression plot
Curves for different tau values

Code snapshot

Key lines that anchor the experiment workflow.

weights = np.exp(-np.sum((X_train - x)**2, axis=1) / (2 * tau**2))
W = np.diag(weights)

Next steps

Want to explore further? Try the full gallery or open the raw script to tweak parameters.