input: Write a function to perform linear regression for predicting the numbers in a given dataset. The function should take two lists X and Y as input, where X represents the independent variables and Y represents the dependent variables. The function should return the predicted value for a new input.
  
  
  def linear_regression(X, Y, new_input):
      import numpy as np
      from sklearn.linear_model import LinearRegression
  
      X = np.array(X).reshape(-1, 1)
      Y = np.array(Y)
  
      model = LinearRegression()
      model.fit(X, Y)
  
      return model.predict(np.array([new_input]).reshape(-1, 1))[0]
  
  # Test cases
  assert linear_regression([1, 2, 3, 4, 5], [3, 5, 7, 9, 13], 6) == 11.0
  assert linear_regression([1, 2, 3, 4, 5], [3, 5, 7, 9, 13], 7) == 13.0
  assert linear_regression([1, 3, 5, 7, 9], [2, 4, 6, 8, 10], 6) == 7.0
  assert linear_regression([1, 2, 3, 4, 5], [3, 5, 7, 9, 13], 8) == 15.0
  assert linear_regression([1, 2, 3, 4, 5], [3, 5, 7, 9, 13], 9) == 17.0
  
output: def linear_regression(X, Y, new_input):
      import numpy as np
      from sklearn.linear_model import LinearRegression
  
      X = np.array(X).reshape(-1, 1)
      Y = np.array(Y)
  
      model = LinearRegression()
      model.fit(X, Y)
  
      return model.predict(np.array([new_input]).reshape(-1, 1))[0]