input: Write a function to create a machine learning model in Python that predicts customer lifetime value given a customer's past transactions. The function should preprocess the data, train a RandomForestRegressor model, and then return the predicted customer lifetime value. If the input data is empty, the function should return 0.
  assert predict_customer_ltv([[10,100,5]]) != 0
  assert predict_customer_ltv([]) == 0
  assert predict_customer_ltv([[5,200,3], [10,300,5]]) != 0
output: def predict_customer_ltv(transactions):
      if not transactions:
          return 0
      
      import numpy as np
      from sklearn.ensemble import RandomForestRegressor
      from sklearn.model_selection import train_test_split
      
      X = np.array(transactions)
      y = X[:, 1]  # Using the second column as the target variable
      
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
      
      model = RandomForestRegressor(n_estimators=100, random_state=42)
      model.fit(X_train, y_train)
      
      return model.predict(X_test)[0]