input: Write a function to implement a simple linear regression model in Python using Pandas for data manipulation, Matplotlib for visualization, and Scikit-learn for the linear regression model. The function should read data from a CSV file, set the input and output variables, train the model, make predictions, and visualize the results. The CSV file is assumed to have columns 'X' and 'Y'.
  assert linear_regression([[1, 2], [2, 3], [3, 4], [4, 5]])==[[1, 2], [2, 3], [3, 4], [4, 5]]
  assert linear_regression([[5, 6], [6, 7], [7, 8], [8, 9]])==[[5, 6], [6, 7], [7, 8], [8, 9]]
  assert linear_regression([[10, 11], [11, 12], [12, 13], [13, 14]])==[[10, 11], [11, 12], [12, 13], [13, 14]]
  assert linear_regression([[15, 16], [16, 17], [17, 18], [18, 19]])==[[15, 16], [16, 17], [17, 18], [18, 19]]
  assert linear_regression([])==[]
output: 
  def linear_regression(data):
      if not data:
          return []
      df = pd.DataFrame(data, columns=['X', 'Y'])
      X = df[['X']]
      y = df['Y']
      model = LinearRegression()
      model.fit(X, y)
      predictions = model.predict(X)
      plt.scatter(X, y, color='blue')
      plt.plot(X, predictions, color='red')
      plt.xlabel('X')
      plt.ylabel('Y')
      plt.title('Simple Linear Regression')
      plt.show()
      return data
  