<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.fann.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.fann-read-train-from-file.php',
    1 => 'fann_read_train_from_file',
    2 => 'Reads a file that stores training data',
  ),
  'up' => 
  array (
    0 => 'ref.fann.php',
    1 => 'Fann Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.fann-randomize-weights.php',
    1 => 'fann_randomize_weights',
  ),
  'next' => 
  array (
    0 => 'function.fann-reset-errno.php',
    1 => 'fann_reset_errno',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/fann/functions/fann-read-train-from-file.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.fann-read-train-from-file" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fann_read_train_from_file</h1>
  <p class="verinfo">(PECL fann &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">fann_read_train_from_file</span> &mdash; <span class="dc-title">Reads a file that stores training data</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.fann-read-train-from-file-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>fann_read_train_from_file</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="para rdfs-comment">
   Reads a file that stores training data.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.fann-read-train-from-file-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">filename</code></dt>
    <dd>
     <p class="para">
      The input file in the following format:
     </p>
     <div class="example-contents">
<div class="txtcode"><pre class="txtcode">num_train_data num_input num_output
inputdata separated by space
outputdata separated by space

.
.
.

inputdata separated by space
outputdata separated by space</pre>
</div>
     </div>

    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fann-read-train-from-file-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para"> Returns a train data <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> on success, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on error.</p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.fann-read-train-from-file-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="methodname"><strong>fann_read_train_from_file()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$train_data </span><span style="color: #007700">= </span><span style="color: #0000BB">fann_read_train_from_file</span><span style="color: #007700">(</span><span style="color: #DD0000">"xor.data"</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$train_data</span><span style="color: #007700">) {<br />    </span><span style="color: #FF8000">// Do something with $train_data for XOR function<br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Contents of xor.data</p></div>
    <div class="example-contents">
<div class="txtcode"><pre class="txtcode">4 2 1
-1 -1
-1
-1 1
1
1 -1
1
1 1
-1</pre>
</div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.fann-read-train-from-file-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fann-train-on-data.php" class="function" rel="rdfs-seeAlso">fann_train_on_data()</a> - Trains on an entire dataset for a period of time</span></li>
    <li><span class="function"><a href="function.fann-destroy-train.php" class="function" rel="rdfs-seeAlso">fann_destroy_train()</a> - Destructs the training data</span></li>
    <li><span class="function"><a href="function.fann-save-train.php" class="function" rel="rdfs-seeAlso">fann_save_train()</a> - Save the training structure to a file</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>