BackgroundHere's a script you can use (with modifications) to analyse the performance of your neural network. The output is unabashedly copied from Neuro-Lab, with some improvements. Output looks like this.
CODE:
Please log in to see this code.
Why use this script?1. Evaluate at any time, during or after training the NN. Neuro-Lab's equivalent "Evaluate Performance" tab is unavailable after training. I find this script useful to check an NN's efficacy, even months after it was trained.
2. The script provides additional statistics: correlation and Least Squares Alpha and Beta. Since it's a script, you are able to add other statistics to meet your needs. This script provides a framework.
3. Greater control of input date ranges. The script uses the same "Data Range" as a strategy script. How is this useful? You might want to select a year at a time and compare correlation, year to year, to evaluate robustness.
4. Save the evaluation results by copying the Debug Log into a document.
5. Compare using different portfolios. I typically run Neuro-Lab against the portfolio I propose to write a strategy for. Using this tool, I've found that a given NN sometimes correlates to other portfolios, too.
6. Compare NNs. Multiple neural networks can be tested with this script, based on a parameter. So, I can set up a date range and portfolio, then quickly compare the NNs. The code included below is customized for three neural networks, "Broad Markets" which comes with Neuro-Lab, plus two of my own.
7. You can create a .CSV from the Debug Log to do additional analysis. I do an XY graph of the predicted and actual columns, typically.
What does "(with modifications)" mean?Nothing worthwhile comes for free. Obviously, this script needs to know about your neural network. You must hand tailor the script for this. Update variable "availNN" with your NN name(s). You'll need to add your network's output script and the MinOutput and MaxOutput values from your network's XML. I've left the customizations I use for my networks as prototypes.
Caveats1. The script only runs as a multi-symbol backtest(MSB), because I chose not to implement the convoluted reflection code for detecting MSB/SSB. Workaround - a portfolio having only one symbol.
2. Even if you want to try this routine with "Broad Markets", you'll need to do some prep. First you'll need to train "Broad Markets" and finds its XML. Then you'll need to update routine "SetupBroadMarkets" with your trained values of minOutput and maxOutput. The values in the script are based on the portfolio and date range I used when I trained "Broad Markets".
Any feedback would be appreciated.
CODE:
Please log in to see this code.