Professional Documents
Culture Documents
4 - Prediction
4 - Prediction
2 of 23
5 of 23 6 of 23
1
Simple Worked Example The Data
Price Cover Competition Advert spend Sales
22 Political No 5900 15392
14000
39 Sport No 5600 13753
– Advertising 32
23
Political
Royal
No
High Val
5900
5600
14852
15345
13500
0 10 20 30 40 50
spend 31
27
Sport
Royal
No
No
5800
5900
14315
14947
31 Sport No 5300 14511
7 of 23 8 of 23
2
Neural Network Training How are the Weights Changed?
1. Prepare the data so that a file contains the predictors and • Training data has inputs and outputs, in this
the predicted variables with an example per row
2. Split the data into a test set and a training set example, newspaper details and sales figures
3. Read each row in turn into the neural network, • The MLP starts with random weights
presenting the predictors as inputs and the predicted
value as the target output • Each example in the training data is used as an
4. Make a prediction and compare the value given by the input and the network generates an output
neural network to the target value
5. Update the weights – see next slide • The difference between that output and the value
6. Present the next example in the file in the training data is known as the error
7. Repeat until the error no longer reduces – ideally stop
when the test error is at its lowest.
13 of 23 14 of 23
17 of 23 18 of 23
3
Non-linear? Non-linear?
5 0.3
0.2
3
0.15
2
0.1
0
0.05
in x depends on the current value of x. ” Where ever you are along the Here, moving a unit to the right
line on the linear plot above, on the line above will carry you
moving one unit to the right up a different amount, depending
will move you up 5 units. on where you are: non-linear
The 1/5 ratio is constant
19 of 23 20 of 23
so the relationship is linear
21 of 23 22 of 23
Disadvantages
• How predictions are gained can be hard to
understand by a human user
• Not easy to ask why an answer was given
(though some help is possible)
• No rules to look at
• Can make big errors if not trained properly
• Requires a certain degree of faith!
23 of 23