code: public int getNumWeights() {
      if (weights == null) return 0;
      int numWeights = 0;
      for (double[] wts : weights) {
        numWeights += wts.length;
      }
      return numWeights;
    }
docs: Returns the total number of weights associated with this classifier.
  
  @return number of weights