Body: <p>I’ve set up a neural network model to experiment with predicting foreign exchange rates based on various economic data. The model learned fine and the test data is OK (<span class="math-container">$R^2 = 0.88$</span>).</p>
  <p>But I can't figure out how to input data for scenarios where new data is outside the range of the datasets used to train the model. For example, if US debt is increased (again), then it will be outside the data range used for the training datasets, so, when normalised using the same parameters as the training dataset (0-1 scale), it will be greater than 1, so the model rejects it.</p>
  <p>Everything I've read says to normalise the new data using the training data parameters (understandably), but I can't find anything that explains how to use the model to make predictions where new data is outside the range of the training datasets.</p>
  <p>In parallel, I've used a regression model, but I'm fairly new to neural networks and would like to find a way of using these for this kind of prediction model. Any help gratefully received.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-12T17:39:21.387Z
Comments.Text: This part "when normalised using the same parameters as the training dataset (0-1 scale), it will be greater than 1, so the model rejects it." is not very clear. Are you normalizing the inputs? Can you describe more in detail 1. what and how are you normalizing, 2. which parameters of the model are you referring to?, 3. Why exactly you cannot normalise the test dat in the same way? I don't get why "it will be greater than 1".
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-12T20:35:27.347Z
Comments.Text: Also, would be good to clarify what "the model rejects it" mean. Neural networks should be able to handle inputs outside of the (0-1) scales, regardless of the stability of prediction. What library are you using?
Comments.UserDisplayName: user3667125
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-13T19:01:27.387Z
Comments.Text: All inputs (7+target) are normalised using (x-min)/(max-min) hence the 0-1 scale from normalising the training data.   So if US debt max was, say USD18tn and the latest input is now USD24tn it will be greater than 1 using the normalisation paramaters from the training dataset.
Comments.UserDisplayName: johnb
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-13T19:17:55.400Z
Comments.Text: In reply to what library - I'm using the Knime platform for now as a quick way to test how useful the model might be.  The Knime "node" is  RProp Multi-layer Perceptron which uses the logistic activation function for forward propogation.   I've been trying to run alternative model structures so will need to rebuild the model as before to replicate the exact error message.
Comments.UserDisplayName: johnb
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-13T21:00:57.453Z
Comments.Text: I'll close this question, with thanks to nbro for his comments.  With reassurance that "Neural networks should be able to handle inputs outside of the (0-1) scales, regardless of the stability of prediction",  I dug a little deeper and the issue was being generated by the denormalisation step saying the value of the new prediction was out of bounds. ie, larger than the maximum value from the training data.  I've now resolved this by breaking down the steps in the model and double checking the output.by extracting the actual parameters used in the normalisation step.
Comments.UserDisplayName: johnb
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-13T21:05:55.177Z
Comments.Text: Also, for info although not a programming point, I've changed the input data to use ratios of similar parameters rather than absolute values,eg, for EUR.USD, use the ratio of US debt to EU debt as the input rather than the two debt figures separately.  This should keep any out-of-range values a lot closer to the training data range unless the economic world gets really out of whack!
Comments.UserDisplayName: johnb
Tags: <neural-networks><machine-learning><prediction>
Title: How to deal with predictions for data outside the range of the training dataset in neural networks?
UserDisplayName: johnb
ThreadText: # How to deal with predictions for data outside the range of the training dataset in neural networks?
  
  (Asked by: username_0 on 2020-12-12)
  
  I’ve set up a neural network model to experiment with predicting foreign exchange rates based on various economic data. The model learned fine and the test data is OK ($R^2 = 0.88$).
  
  But I can't figure out how to input data for scenarios where new data is outside the range of the datasets used to train the model. For example, if US debt is increased (again), then it will be outside the data range used for the training datasets, so, when normalised using the same parameters as the training dataset (0-1 scale), it will be greater than 1, so the model rejects it.
  
  Everything I've read says to normalise the new data using the training data parameters (understandably), but I can't find anything that explains how to use the model to make predictions where new data is outside the range of the training datasets.
  
  In parallel, I've used a regression model, but I'm fairly new to neural networks and would like to find a way of using these for this kind of prediction model. Any help gratefully received.
  
  **Tags:** neural-networks, machine-learning, prediction
  
  > **Comments:**
  > **username_1**: This part "when normalised using the same parameters as the training dataset (0-1 scale), it will be greater than 1, so the model rejects it." is not very clear. Are you normalizing the inputs? Can you describe more in detail 1. what and how are you normalizing, 2. which parameters of the model are you referring to?, 3. Why exactly you cannot normalise the test dat in the same way? I don't get why "it will be greater than 1".  
  > **username_2**: Also, would be good to clarify what "the model rejects it" mean. Neural networks should be able to handle inputs outside of the (0-1) scales, regardless of the stability of prediction. What library are you using?  
  > **username_0**: All inputs (7+target) are normalised using (x-min)/(max-min) hence the 0-1 scale from normalising the training data.   So if US debt max was, say USD18tn and the latest input is now USD24tn it will be greater than 1 using the normalisation paramaters from the training dataset.  
  > **username_0**: In reply to what library - I'm using the Knime platform for now as a quick way to test how useful the model might be.  The Knime "node" is  RProp Multi-layer Perceptron which uses the logistic activation function for forward propogation.   I've been trying to run alternative model structures so will need to rebuild the model as before to replicate the exact error message.  
  > **username_0**: I'll close this question, with thanks to username_1 for his comments.  With reassurance that "Neural networks should be able to handle inputs outside of the (0-1) scales, regardless of the stability of prediction",  I dug a little deeper and the issue was being generated by the denormalisation step saying the value of the new prediction was out of bounds. ie, larger than the maximum value from the training data.  I've now resolved this by breaking down the steps in the model and double checking the output.by extracting the actual parameters used in the normalisation step.  
  > **username_0**: Also, for info although not a programming point, I've changed the input data to use ratios of similar parameters rather than absolute values,eg, for EUR.USD, use the ratio of US debt to EU debt as the input rather than the two debt figures separately.  This should keep any out-of-range values a lot closer to the training data range unless the economic world gets really out of whack!  
  
  ---
  
  ## 0 answers
  
  