The Complete SPRLIB & ANNLIB

sample_perf

- compute the performance of a network on a sample

SYNOPSIS

ERROR_STRUCT *sample_perf (net, sample, err_struct, err_threshold)

ARGUMENTS

NET *net A pointer to a feedforward NET.
SAMPLE *sample A pointer to a SAMPLE structure.
ERROR_STRUCT *err_struct A pointer to an ERROR_STRUCT structure containing the errors. If NULL, the routine allocates a new structure.
double err_threshold Value below which the difference between the target and actual output is considered to be low enough to find the classification correct.

RETURNS

A pointer to an ERROR_STRUCT in case of success, NULL in case an error was encountered.

FUNCTION

This function evaluates the network using sample and then calculates the error for each output unit. From these errors, it finds the values in the ERROR_STRUCT: the maximum error MaxError, the minimum error MinError, the MSE MeanSquaredError, the percentage correct PercentageCorrect, and the AllCorrect flag. PercentageClassCorrect is set to 100 if the sample is classified correctly and to 0 if not. Correct classification is defined as the index of the unit with the highest output matching the index of the maximum target vector value.

NOTE

Note that AllCorrect is TRUE when all output units are considered correct, not all samples in the dataset. Also, PercentageCorrect is the percentage of output units considedered to give correct output (with respect to err_threshold).

SEE ALSO

perf_init, net_perf, perf_free, error_struct_array

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998