Exemple #1
0
  /**
   * initialize various variables before starting the actual optimizer
   *
   * @param data data set used for learning
   * @throws Exception if something goes wrong
   */
  protected void init(Instances data) throws Exception {
    super.init(data);

    // init error cache
    m_error = new double[m_nInstances];
    for (int i = 0; i < m_nInstances; i++) {
      m_error[i] = -m_target[i];
    }
  }
Exemple #2
0
  /**
   * Parses a given list of options.
   *
   * <p>
   * <!-- options-start -->
   * Valid options are:
   *
   * <p>
   *
   * <pre> -P &lt;double&gt;
   *  The epsilon for round-off error.
   *  (default 1.0e-12)</pre>
   *
   * <pre> -L &lt;double&gt;
   *  The epsilon parameter in epsilon-insensitive loss function.
   *  (default 1.0e-3)</pre>
   *
   * <pre> -W &lt;double&gt;
   *  The random number seed.
   *  (default 1)</pre>
   *
   * <!-- options-end -->
   *
   * @param options the list of options as an array of strings
   * @throws Exception if an option is not supported
   */
  public void setOptions(String[] options) throws Exception {
    String tmpStr;

    tmpStr = Utils.getOption('P', options);
    if (tmpStr.length() != 0) {
      setEpsilon(Double.parseDouble(tmpStr));
    } else {
      setEpsilon(1.0e-12);
    }

    super.setOptions(options);
  }
Exemple #3
0
 /**
  * wrap up various variables to save memeory and do some housekeeping after optimization has
  * finished.
  *
  * @throws Exception if something goes wrong
  */
 protected void wrapUp() throws Exception {
   m_error = null;
   super.wrapUp();
 }