Skip to content
All library documents

Probabilistic Neural Network Classifier: Training, Prediction, and File Handling

Article MQL5 code base

Summary

This document describes a software class for a probabilistic neural network used for classification. A constructor takes the input-vector size and number of target classes; class labels are zero-based and must be consecutive. Training data are supplied as flattened input and output arrays, with a training call bounded by either a cycle count or an allowed error. The class reports completion, learning error, and completed cycles, and returns error codes for invalid class labels or insufficient memory.

Prediction returns the class assigned to an input vector, or an error value if the network has not been trained. The class can save and load its topology, errors, and weights using binary file operations, and loading fails if the configured topology differs. An XOR example is cited as a demonstration. The document explains the interface and operational constraints, but gives no trading application, market data, benchmark, or evidence that this classifier improves investment decisions. It also does not discuss feature design, validation, or overfitting, so those concerns would need separate treatment before using a model in research or trading.

Key ideas

  • The classifier accepts a configured input dimension and a fixed set of consecutive, zero-based class labels.
  • Training stops according to a cycle limit or an allowed error and reports the result.
  • Prediction requires a trained network and returns a class label for the input vector.
  • Saved model files include topology, training error, and weights; loading requires matching topology.
  • The XOR example illustrates the interface but provides no financial validation.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.