input: Write a function to implement a basic machine learning model in Python that performs binary classification on the given data. The function should take as input a feature matrix X and a label vector y, and return the accuracy of the model on the training data.
  
  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.2, 0.1], [0.2, 0.3, 0.2], [0.3, 0.1, 0.3], [0.4, 0.4, 0.4], [0.5, 0.5, 0.5]], [0, 1, 0, 1, 0])==0.6
  assert binary_classification([[0.9, 0.1, 0.2], [0.8, 0.2, 0.3], [0.7, 0.3, 0.4], [0.6, 0.4, 0.5], [0.5, 0.5, 0.6]], [1, 1, 1, 0, 0])==0.4
  assert binary_classification([], [])==0.0
  assert binary_classification([[0.1, 0.1, 0.1], [0.2, 0.2, 0.2], [0.3, 0.3, 0.3], [0.4, 0.4, 0.4], [0.5, 0.5, 0.5]], [0, 0, 0, 0, 0])==1.0
output: def binary_classification(X, y):
      if not X or not y:
          return 0.0
      from sklearn.linear_model import LogisticRegression
      model = LogisticRegression()
      model.fit(X, y)
      y_pred = model.predict(X)
      return sum(y_pred == y) / len(y)