code: private static ClassicCounter<Integer> getWeights(List<Pair<Double, ClassicCounter<Integer>>> supportVectors) {
      ClassicCounter<Integer> weights = new ClassicCounter<Integer>();
      for (Pair<Double, ClassicCounter<Integer>> sv : supportVectors) {
        ClassicCounter<Integer> c = new ClassicCounter<Integer>(sv.second());
        Counters.multiplyInPlace(c, sv.first());
        Counters.addInPlace(weights, c);
      }
      return weights;
    }
docs: Takes all the support vectors, and their corresponding alphas, and computes a weight
  vector that can be used in a vanilla LinearClassifier.  This only works because
  we are using a linear kernel.  The Counter is over the feature indices (+1 cos for
  some reason svm_light is 1-indexed), not features.