import numpy as np

def locally_weighted_regression(X, y, tau=0.1):
    m, n = X.shape
    predictions = np.zeros(m)
    for i in range(m):
        weights = np.exp(-np.sum((X - X[i])**2, axis=1) / (2 * tau**2))
        W = np.diag(weights)
        X_transpose = X.T
        theta = np.linalg.inv(X_transpose @ W @ X) @ X_transpose @ W @ y
        predictions[i] = X[i] @ theta
    return predictions
