php8.5
Home/ Manual/ fann / functions/ fann_read_train_from_file

fann_read_train_from_file

PHP function Edit on GitHub ✎

(PECL fann >= 1.0.0)

Reads a file that stores training data

Description

fann_read_train_from_file(string $filename): resource

Reads a file that stores training data.

Parameters

filename

The input file in the following format:

txt
num_train_data num_input num_output
inputdata separated by space
outputdata separated by space

.
.
.

inputdata separated by space
outputdata separated by space

Return Values Train

Examples

fann_read_train_from_file example

php
<?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

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

See Also

Source: reference/fann/functions/fann-read-train-from-file.xml · from the official PHP manual (php/doc-en)