code: public void setWeights(double[] weights, int[] weightLabels) {
          if (weights == null) throw new IllegalArgumentException("'weight' must not be null");
          if (weightLabels == null || weightLabels.length != weights.length)
              throw new IllegalArgumentException("'weightLabels' must have same length as 'weight'");
          this.weightLabel = copyOf(weightLabels, weightLabels.length);
          this.weight = copyOf(weights, weights.length);
      }
docs: <p>nr_weight, weight_label, and weight are used to change the penalty
  for some classes (If the weight for a class is not changed, it is
  set to 1). This is useful for training classifier using unbalanced
  input data or with asymmetric misclassification cost.</p>
  
  <p>Each weight[i] corresponds to weight_label[i], meaning that
  the penalty of class weight_label[i] is scaled by a factor of weight[i].</p>
  
  <p>If you do not want to change penalty for any of the classes,
  just set nr_weight to 0.</p>