input: Write a function to create a machine learning algorithm that categorizes a dataset of records using a Support Vector Machine (SVM). The function should take a list of records with features and labels as input, train the model, and return the predicted label for a given set of features. The function should use numpy for array manipulation and the sklearn library for the SVM model.
  assert categorize_records([
   {"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_records([
   {"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_records([
   {"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"
output: def categorize_records(records, features):
      import numpy as np
      from sklearn import svm
      from sklearn.preprocessing import LabelEncoder
      
      X = np.array([record['features'] for record in records])
      y = np.array([record['label'] for record in records])
      
      le = LabelEncoder()
      y = le.fit_transform(y)
      
      clf = svm.SVC()
      clf.fit(X, y)
      
      predicted_label = clf.predict([features])
      return le.inverse_transform(predicted_label)[0]