code: public void setRegularization(double reg)
      {
          if(Double.isInfinite(reg) || Double.isNaN(reg) || reg <= 0.0)
              throw new ArithmeticException("Pegasos requires a positive regularization cosntant");
          this.reg = reg;
      }
docs: Sets the regularization constant used for learning. The regularization
  must be positive, and the learning rate is proportional to the
  regularization value. This means regularizations very near zero will
  take a long time to converge.
  
  @param reg the regularization to apply