input: Write a function to generate a simple linear regression model in Python. The function should read data from a CSV file, train the model, and then visualize the results by plotting the actual data points and the regression line in a graph. Ensure that the function imports necessary libraries such as pandas, matplotlib, and sklearn.linear_model.
  assert linear_regression()
  assert linear_regression()
  assert linear_regression()
  assert linear_regression()
  assert linear_regression()
output: 
  def linear_regression():
      import pandas as pd
      import matplotlib.pyplot as plt
      from sklearn.linear_model import LinearRegression
  
      data = pd.read_csv('data.csv')
      X = data[['X']]
      y = data['y']
  
      model = LinearRegression()
      model.fit(X, y)
  
      plt.scatter(X, y, color='blue')
      plt.plot(X, model.predict(X), color='red')
      plt.xlabel('X')
      plt.ylabel('y')
      plt.title('Linear Regression')
      plt.show()
  