示例#1
0
  /**
   * Adds new row element to this data set
   *
   * @param row data set row to add
   */
  public void addRow(DataSetRow row) throws VectorSizeMismatchException {

    if (row == null) {
      throw new NeurophException("Training dta row cannot be null!");
    }

    // check input vector size if it is predefined
    if ((this.inputSize != 0) && (row.getInput().length != this.inputSize)) {
      throw new VectorSizeMismatchException(
          "Input vector size does not match data set input size!");
    }

    if ((this.outputSize != 0) && (row.getDesiredOutput().length != this.outputSize)) {
      throw new VectorSizeMismatchException(
          "Output vector size does not match data set output size!");
    }

    // if everything went ok add training element
    this.rows.add(row);
  }