fann_read_train_from_file

Reads a file that stores training data

&reftitle.description; `resource` `fann_read_train_from_file` `string` `filename`

Reads a file that stores training data.

&reftitle.parameters;

`filename`

- The input file in the following format:

      num_train_data num_input num_output
      inputdata separated by space
      outputdata separated by space

      .
      .
      .

      inputdata separated by space
      outputdata separated by space

&reftitle.returnvalues; &fann.return.train;
&reftitle.examples;

### `fann_read_train_from_file` example

    <?php
    $train_data = fann_read_train_from_file("xor.data");
    if ($train_data) {
        // Do something with $train_data for XOR function
    }
    ?>

Contents of xor.data

    4 2 1
    -1 -1
    -1
    -1 1
    1
    1 -1
    1
    1 1
    -1

&reftitle.seealso;

- `fann_train_on_data`
- `fann_destroy_train`
- `fann_save_train`