I'm currently working on a DQN network and this question comes to me. As far as I know, neural networks are good at dealing with values that have never seen (generalisation). E.g. If a classification model classifies two samples with the same features except for
feature A, the first sample has a value of 10.0 and the second sample has a value of 9.9. And they are both classified correctly to
class C. Then when tested on a similar sample which has its
feature A value equals 9.85, it is most likely to be classified to
class C as well.
However, if the comparison is the key to classification/regression. For example, the 'hidden rule' is: if
feature A > feature B, then
class C, otherwise
class D. Since the comparison relation is not known, we cannot feed in the binary comparison result as a feature. Can neural networks still handle this well? Or some particular structure/feature engineering/algorithm can help with this situation.
For example, if
feature B is equal to 9.88 in the above example, the model has seen samples with
feature A values of 10.0, 9.9, 9.95, 9.89, and they all fall into
class C, and another group of samples with
feature A value of 8.0,9.0,9.7, and they fall into
class D, then this 9.85 sample come into test. How can the model classify it correctly?