input: Write a function to implement a basic machine learning model that performs binary classification on the given data. The function should return the accuracy of the model. If the input data is empty, the function should return 0.
  
  assert binary_classification([[0.3, 0.2, 0.6], [0.3, 0.1, 0.4], [0.2, 0.3, 0.4], [0.7, 0.4, 0.2], [0.5, 0.2, 0.1]], [1, 0, 0, 1, 0])==1.0
  assert binary_classification([], [])==0
  assert binary_classification([[0.1, 0.2, 0.3], [0.9, 0.8, 0.7]], [0, 1])==1.0
output: def binary_classification(data, labels):
      if not data:
          return 0
      from sklearn.linear_model import LogisticRegression
      model = LogisticRegression()
      model.fit(data, labels)
      accuracy = model.score(data, labels)
      return accuracy