docs: def predict(self, features):
          """Dot-product the features and current weights and return the best label."""
          scores = defaultdict(float)
          for feat in features:
              if feat not in self.weights:
                  continue
              weights = self.weights[feat]
              for label, weight in weights.items():
                  scores[label] += weight
          # Do a secondary alphabetic sort, for stability
          return max(self.classes, key=lambda label: (scores[label], label))