input: Write a python function to implement and test the LinearRegression class.
  assert lr.fit() == (2.0, 1.0)  # Assuming a perfect linear data
  assert (lr.predict(2.0, 1.0, np.array([1, 2, 3])) == np.array([3.0, 5.0, 7.0])).all()
  assert (lr.predict(0, 0, np.array([1, 2, 3])) == np.array([0.0, 0.0, 0.0])).all()
output: import numpy as np
  
  class LinearRegression:
      def __init__(self):
          self.slope = None
          self.intercept = None
  
      def fit(self, X, y):
          n = len(X)
          mean_X, mean_y = np.mean(X), np.mean(y)
          SS_xy = np.sum(y*X) - n*mean_y*mean_X
          SS_xx = np.sum(X*X) - n*mean_X*mean_X
          self.slope = SS_xy / SS_xx
          self.intercept = mean_y - self.slope*mean_X
          return self.slope, self.intercept
  
      def predict(self, slope, intercept, X):
          return slope * X + intercept
  
  # Test the implementation
  lr = LinearRegression()
  X = np.array([1, 2, 3])
  y = np.array([3, 5, 7])
  assert lr.fit(X, y) == (2.0, 1.0)
  assert (lr.predict(2.0, 1.0, np.array([1, 2, 3])) == np.array([3.0, 5.0, 7.0])).all()
  assert (lr.predict(0, 0, np.array([1, 2, 3])) == np.array([0.0, 0.0, 0.0])).all()