input: Write a function that implements a basic machine learning model in Python to perform binary classification on the given data using the logistic regression algorithm. Return the accuracy of the model as a float.
  
  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.1, 0.4, 0.5], [0.9, 0.1, 0.2], [0.5, 0.5, 0.5], [0.2, 0.8, 0.3], [0.4, 0.7, 0.2]], [0, 1, 1, 0, 1])==0.6
  assert binary_classification([], [])==0.0
  
  
output: def binary_classification(data, labels):
      if not data or not labels:
          return 0.0
      model = LogisticRegression()
      model.fit(data, labels)
      predictions = model.predict(data)
      accuracy = sum(predictions == labels) / len(labels)
      return accuracy