AI-Perceptron-Simple
view release on metacpan or search on metacpan
docs/AI-Perceptron-Simple-1.04.html view on Meta::CPAN
<p>This is the index of the column that contains the predicted output values. <code>$index</code> starts from <code>0</code>.</p>
<p>This column will be filled with binary numbers and the full new data will be saved to the file specified in the <code>results_write_to</code> key.</p>
</dd>
<dt id="results_write_to-new_csv_file">results_write_to => $new_csv_file</dt>
<dd>
<p>Optional.</p>
<p>The default behaviour will write the predicted output back into <code>stimuli_validate</code> ie the original data. The sequence of the data will be maintained.</p>
</dd>
</dl>
<p><i>*This method will call <code>_real_validate_or_test</code> to do the actual work.</i></p>
<h1 id="TESTING-RELATED-SUBROUTINES-METHODS">TESTING RELATED SUBROUTINES/METHODS</h1>
<p>All the testing methods here have the same parameters as the actual <code>test</code> method and they all do the same stuff. They are also used in the same way.</p>
<h2 id="take_real_exam">take_real_exam (...)</h2>
<h2 id="work_in_real_world">work_in_real_world (...)</h2>
<h2 id="test-options">test ( \%options )</h2>
<p>This method is used to put the trained nerve to the test. You can think of it as deploying the nerve for the actual work or maybe putting the nerve into an empty brain and see how well the brain survives :)</p>
<p>This method works and behaves the same way as the <code>validate</code> method. See <code>validate</code> for the details.</p>
<p><i>*This method will call &_real_validate_or_test to do the actual work.</i></p>
<h2 id="real_validate_or_test-data_hash_ref">_real_validate_or_test ( $data_hash_ref )</h2>
<p>This is where the actual validation or testing takes place.</p>
<p><code>$data_hash_ref</code> is the list of parameters passed into the <code>validate</code> or <code>test</code> methods.</p>
<p>This is a <b>method</b>, so use the OO way. This is one of the exceptions to the rules where private subroutines are treated as methods :)</p>
<h2 id="fill_predicted_values-self-stimuli_validate-predicted_index-aoa">&_fill_predicted_values ( $self, $stimuli_validate, $predicted_index, $aoa )</h2>
<p>This is where the filling in of the predicted values takes place. Take note that the parameters naming are the same as the ones used in the <code>validate</code> and <code>test</code> method.</p>
<p>This subroutine should be called in the procedural way.</p>
<h1 id="RESULTS-RELATED-SUBROUTINES-METHODS">RESULTS RELATED SUBROUTINES/METHODS</h1>
<p>This part is related to generating the confusion matrix.</p>
<h2 id="get_exam_results">get_exam_results ( ... )</h2>
<p>The parameters and usage are the same as <code>get_confusion_matrix</code>. See the next method.</p>
<h2 id="get_confusion_matrix-options">get_confusion_matrix ( \%options )</h2>
<p>Returns the confusion matrix in the form of a hash. The hash will contain these keys: <code>true_positive</code>, <code>true_negative</code>, <code>false_positive</code>, <code>false_negative</code>, <code>accuracy</code>, <code>sensitivity</code>...
<p>If you are trying to manipulate the confusion matrix hash or something, take note that all the stats are in percentage (%) in decimal (if any) except the total entries.</p>
<p>For <code>%options</code>, the followings are needed unless mentioned:</p>
<dl>
<dt id="full_data_file-filled_test_file">full_data_file => $filled_test_file</dt>
<dd>
<p>This is the CSV file filled with the predicted values.</p>
<p>Make sure that you don't do anything to the actual and predicted output in this file after testing the nerve. These two columns must contain binary values only!</p>
</dd>
<dt id="actual_output_header-actual_column_name">actual_output_header => $actual_column_name</dt>
<dd>
</dd>
<dt id="predicted_output_header-predicted_column_name">predicted_output_header => $predicted_column_name</dt>
<dd>
<p>The binary values are treated as follows:</p>
<dl>
<dt id="is-negative"><code>0</code> is negative</dt>
<dd>
</dd>
<dt id="is-positive"><code>1</code> is positive</dt>
<dd>
</dd>
</dl>
</dd>
<dt id="more_stats-1">more_stats => 1</dt>
<dd>
<p>Optional.</p>
<p>Setting it to <code>1</code> will process more stats that are usually not so important eg. <code>precision</code>, <code>specificity</code> and <code>F1_Score</code></p>
</dd>
</dl>
<h2 id="collect_stats-options">&_collect_stats ( \%options )</h2>
<p>Generates a hash of confusion matrix based on <code>%options</code> given in the <code>get_confusion_matrix</code> method.</p>
<h2 id="calculate_total_entries-c_matrix_ref">&_calculate_total_entries ( $c_matrix_ref )</h2>
<p>Calculates and adds the data for the <code>total_entries</code> key in the confusion matrix hash.</p>
<h2 id="calculate_accuracy-c_matrix_ref">&_calculate_accuracy ( $c_matrix_ref )</h2>
<p>Calculates and adds the data for the <code>accuracy</code> key in the confusion matrix hash.</p>
<h2 id="calculate_sensitivity-c_matrix_ref">&_calculate_sensitivity ( $c_matrix_ref )</h2>
<p>Calculates and adds the data for the <code>sensitivity</code> key in the confusion matrix hash.</p>
( run in 1.153 second using v1.01-cache-2.11-cpan-5837b0d9d2c )