import numpy as np
import matplotlib.pyplot as plt

np.random.seed(0)

def gaussian_rbf_features(X, mu, ell):
    ################
    #your code here#
    ################
    
    return Phi

# Training data
N_train = 100
X_train = np.random.uniform(-1, 1, (N_train, 1))

# Training targets
y_train = np.sin(2 * np.pi * X_train) + 0.2 * np.random.randn(N_train, 1)

# Test data
N_test = 200
X_test = np.linspace(-1, 1, N_test).reshape(-1, 1)

################
#your code here#
################

# Create M Gaussian basis functions
M = 10
mu = np.linspace(np.min(X_train), np.max(X_train), M).reshape(-1, 1)
ell = (np.max(X_train) - np.min(X_train)) / M

# Generate rbf features
phi_train = gaussian_rbf_features(X_train, mu, ell)
phi_test = gaussian_rbf_features(X_test, mu, ell)

################
#your code here#
################