Ejemplo n.º 1
0
  /**
   * Sets instances that should be stored.
   *
   * @param instances the instances
   */
  @Override
  public void setInstances(Instances instances) {
    m_ClassIndex.setUpper(instances.numAttributes() - 1);
    instances.setClassIndex(m_ClassIndex.getIndex());

    super.setInstances(instances);
  }
Ejemplo n.º 2
0
  /**
   * Parses the options for this object.
   *
   * <p>
   * <!-- options-start -->
   * Valid options are:
   *
   * <p>
   *
   * <pre> -i &lt;the input file&gt;
   *  The input file</pre>
   *
   * <pre> -o &lt;the output file&gt;
   *  The output file</pre>
   *
   * <pre> -c &lt;class index&gt;
   *  The class index
   *  (default: last)</pre>
   *
   * <!-- options-end -->
   *
   * @param options the options to use
   * @throws Exception if setting of options fails
   */
  public void setOptions(String[] options) throws Exception {
    String tmpStr;

    tmpStr = Utils.getOption('c', options);
    if (tmpStr.length() != 0) setClassIndex(tmpStr);
    else setClassIndex("last");

    super.setOptions(options);
  }
Ejemplo n.º 3
0
  /**
   * Parses the options for this object.
   *
   * <p>
   * <!-- options-start -->
   * Valid options are:
   *
   * <p>
   *
   * <pre>
   * -i &lt;the input file&gt;
   *  The input file
   * </pre>
   *
   * <pre>
   * -o &lt;the output file&gt;
   *  The output file
   * </pre>
   *
   * <pre>
   * -c &lt;class index&gt;
   *  The class index
   *  (default: last)
   * </pre>
   *
   * <!-- options-end -->
   *
   * @param options the options to use
   * @throws Exception if setting of options fails
   */
  @Override
  public void setOptions(String[] options) throws Exception {
    String tmpStr;

    tmpStr = Utils.getOption('c', options);
    if (tmpStr.length() != 0) {
      setClassIndex(tmpStr);
    } else {
      setClassIndex("last");
    }

    super.setOptions(options);

    Utils.checkForRemainingOptions(options);
  }
Ejemplo n.º 4
0
  /** Resets the Saver */
  public void resetOptions() {

    super.resetOptions();
    setFileExtension(".names");
  }
Ejemplo n.º 5
0
 /** Resets the Saver */
 @Override
 public void resetOptions() {
   super.resetOptions();
   setFileExtension(LibSVMLoader.FILE_EXTENSION);
 }