input: Write a function to create and train a machine learning algorithm in Python that categorizes a dataset of records. The function should use the dataset provided as input to train a model and then predict the label for a given set of features. The function should return the predicted label.
  
  def categorize_data(training_data, predict_data):
      import numpy as np
      from sklearn.svm import SVC
      
      X = []
      y = []
      for data in training_data:
          X.append(data['features'])
          y.append(data['label'])
      
      clf = SVC()
      clf.fit(X, y)
      
      predicted_label = clf.predict([predict_data])
      return predicted_label[0]
  
  assert categorize_data([
    {"label": "apple", "features": [1, 1, 0]}, 
    {"label": "banana", "features": [0, 1, 1]}, 
    {"label": "lemon", "features": [0, 0, 1]}, 
    {"label": "orange", "features": [1, 0, 0]}, 
    {"label": "pear", "features": [0, 1, 0]}, 
  ], [1, 0, 1]) == "banana"
  
  assert categorize_data([
    {"label": "apple", "features": [1, 1, 0]}, 
    {"label": "banana", "features": [0, 1, 1]}, 
    {"label": "lemon", "features": [0, 0, 1]}, 
    {"label": "orange", "features": [1, 0, 0]}, 
    {"label": "pear", "features": [0, 1, 0]}, 
  ], [1, 1, 0]) == "apple"
  
  assert categorize_data([
    {"label": "apple", "features": [1, 1, 0]}, 
    {"label": "banana", "features": [0, 1, 1]}, 
    {"label": "lemon", "features": [0, 0, 1]}, 
    {"label": "orange", "features": [1, 0, 0]}, 
    {"label": "pear", "features": [0, 1, 0]}, 
  ], [0, 1, 0]) == "pear"
  
  assert categorize_data([
    {"label": "apple", "features": [1, 1, 0]}, 
    {"label": "banana", "features": [0, 1, 1]}, 
    {"label": "lemon", "features": [0, 0, 1]}, 
    {"label": "orange", "features": [1, 0, 0]}, 
    {"label": "pear", "features": [0, 1, 0]}, 
  ], [0, 0, 1]) == "lemon"
  
  assert categorize_data([
    {"label": "apple", "features": [1, 1, 0]}, 
    {"label": "banana", "features": [0, 1, 1]}, 
    {"label": "lemon", "features": [0, 0, 1]}, 
    {"label": "orange", "features": [1, 0, 0]}, 
    {"label": "pear", "features": [0, 1, 0]}, 
  ], [1, 0, 0]) == "orange"
output: def categorize_data(training_data, predict_data):
      import numpy as np
      from sklearn.svm import SVC
      
      X = []
      y = []
      for data in training_data:
          X.append(data['features'])
          y.append(data['label'])
      
      clf = SVC()
      clf.fit(X, y)
      
      predicted_label = clf.predict([predict_data])
      return predicted_label[0]