input: Write a function to implement a basic machine learning model in Python that performs binary classification on the given data. The function should train the model on the input data and return the accuracy score of the model.
  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
output: def binary_classification(data, labels):
      from sklearn.linear_model import LogisticRegression
      from sklearn.metrics import accuracy_score
      
      model = LogisticRegression()
      model.fit(data, labels)
      predictions = model.predict(data)
      return accuracy_score(labels, predictions)