input: Write a function to perform linear regression for predicting the numbers in a given dataset. The function should take two lists as input, `X` and `Y`, and use the `LinearRegression` model from `sklearn` to fit the data. It should then predict the value of `Y` for a given value of `X`. If the input lists `X` and `Y` are empty, the function should return an empty list for the predictions.
  
  assert lin_reg([1,2,3,4,5], [3,5,7,9,13]) == [15.2]
  assert lin_reg([], []) == []
  assert lin_reg([1],[3]) == [3.0]
  assert lin_reg([2,3,4],[4,6,8]) == [10.0]
output: def lin_reg(X, Y):
      if not X or not Y:
          return []
      from sklearn.linear_model import LinearRegression
      model = LinearRegression()
      model.fit(np.array(X).reshape(-1, 1), Y)
      return [model.predict([[X[-1] + 1]])[0]]