← Back to all experiments
RegressionIntermediateLocally Weighted Regression

EXP6: 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

Outputs

Locally weighted regression plot
Curves for different tau values

Full Python Code

The complete Python script directly from the repository.

Python
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.