input: Write a function to implement a simple linear regression model in Python. The function should read data from a CSV file, train a linear regression model, make predictions, and visualize the results.
  assert linear_regression('data.csv')==None
  
  Input:
  Not applicable
  
  Output:
  import pandas as pd
  import matplotlib.pyplot as plt
  from sklearn import linear_model
  
  def linear_regression(csv_file):
      # Read data from CSV
      data = pd.read_csv(csv_file)
  
      # Set X and Y
      X = data['X'].values.reshape(-1, 1)
      Y = data['Y']
  
      # Create linear regression model
      model = linear_model.LinearRegression()
  
      # Train the model
      model.fit(X, Y)
  
      # Make predictions
      Y_pred = model.predict(X)
  
      # Visualize the results
      plt.scatter(X, Y)
      plt.plot(X, Y_pred, color='red')
      plt.show()
  
      return None
output: 
  def linear_regression(csv_file):
      data = pd.read_csv(csv_file)
      X = data['X'].values.reshape(-1, 1)
      Y = data['Y']
      model = linear_model.LinearRegression()
      model.fit(X, Y)
      Y_pred = model.predict(X)
      plt.scatter(X, Y)
      plt.plot(X, Y_pred, color='red')
      plt.show()
      return None
  