CSc 8810 CI

Assignment 3 (Neural Networks)

Due 10/2 Wed

1. (100 points) Please use the given BP (back-propagation learning algorithm) program

(Please download

either bpPC.exe

or bpLinux.exe

from the class Web site.)

To train a neural network to learn a past stock market trend using past stock data (please get one stock data from Web sites like yahoo, for example Microsoft stock data in past 100 days), then use the trained neural network to predict stock trend in the future 7 days. Please enter real stock values and the predicted ones in the future 7 days (say last week, so we can do comparison) in a table, and draw an entire stock curve including real past and future data and another prediction curve in the same 2-dimesional space, and the prediction error curve (Matlab may be helpful).

[Note: you need to choose your own stock data (number of past data, structure of a neural network (inputs, hidden neurons and output neurons), etc.]

(1) Train a neural network command:

bpPC LEARN paststock.dat paststock.net 0.45 0.9 0.001 100 3 10 1

Or

bpLinux LEARN paststock.dat paststock.net 0.45 0.9 0.001 100 3 10 1,

where, bpPC, bpLinux : program name

LEARN: to train a neural network

paststock.dat: past stock data file

paststock.net: neural network parameter file

0.45, 0.9: parameters (you don’t need to change them)

0.001: training error, you may change it

100: training cycles

3: number of inputs (input neurons)

10: number of hidden neurons

1: number of outputs (output neurons)

(2) Use the trained neural network to predict future values

bpPC RUN futurestock.dat paststock.net,

or

bpLinux RUN futurestock.dat paststock.net.

where,

RUN: run the trained neural network to generate new outputs based on futurestock.dat

futurestock.dat: just contain 7 different input values used to generate 7 future values like from Monday to Sunday.

How to Use the Neural Network Software

CSc 8810 CI

The XOR problem is solved by the BP learning algorithm.

(1) Train a neural network command:

bpPC LEARN olddata.dat weight.net 0.45 0.9 0.001 100 2 4 1

Or

bpLinux LEARN olddata.dat weight.net 0.45 0.9 0.001 100 2 4 1,

where, bpPC, bpLinux : program name

LEARN: to train a neural network

olddata.dat: past stock data file

weight.net: neural network parameter file

0.45, 0.9: parameters (you don’t need to change them)

0.001: training error, you may change it

100: training cycles

2: number of inputs (input neurons)

4: number of hidden neurons

1: number of outputs (output neurons)

For example:

bpPC LEARN xor.dat weight.net 0.45 0.9 0.001 100 2 4 1

xor.dat is

1 0.1 0.1 0.1

2 0.1 0.9 0.9

3 0.9 0.1 0.9

4 0.9 0.9 0.1

The 1st column is sequential number, then 2 input columns and one output column.

(2) Use the trained neural network to predict future values

bpPC RUN newdata.dat weight.net,

or

bpLinux RUN newdata.dat weight.net.

where,

RUN: run the trained neural network to generate new outputs based on newdata.dat

futurestock.dat: just contain 7 different input values used to generate 7 future values.

For example:

BpPC RUN xor.dat weight.net.