# Is it better to have higher train accuracy with lower test accuracy or higher test accuracy with lower train accuracy?

The results from my RandomForest model with 5 max features are as follows:

84% train accuracy
76% test accuracy


The results with 10 max features:

79% train accuracy
77% test accuracy


Which result should I be favouring? Would I be in correct in saying that the second result is better because the test accuracy is higher even though the train accuracy is lower? Ultimately you want the model to perform best on the test (unseen) data?

Thanks.

Test accuracy better reflects generalization error, so you want the one with higher test accuracy. In your first setup, the higher train accuracy indicates overfitting, as it's significantly higher than train accuracy. This is also kind of why it generalizes less well than the second one.