Why am a getting wrong prediction when combining two list of samples, which individually gives correct prediction?
You have a mistake somewhere in either the data you provide as training data or the model you use for predicting.

If it was really the same model trained on the full data in all the cases, then any given instance in set2 would always be predicted with the same class (right or wrong), independently from the other instances in the test set. This implies that it's not the same model being applied when you predict individual sets or both merged.

As a test, save your model somewhere first then apply it to your different cases (the model that you saved, don't train it again).



Ok so you are trying to do 3 experiments:


Training on full training set produces modelA, then apply modelA on set1
Training on full training set produces modelB, then apply modelB on set2
Training on full training set produces modelC, then apply modelC on both set1 and set2


But if this was really what you are doing the three models would be the same: modelA = modelB = modelC. Basically you could do this instead:


Training on full training set produces modelD
apply modelD on any set


Based on your description what probably happens is something like this:


Training on instances of class A (error) produces modelA, then apply modelA on set1 -> perfect results
Training on instances of class B (error) produces modelB, then apply modelB on set2 -> perfect results
Training on instances of class A (error) produces modelC = modelA, then apply modelC on both set1 and set2: perfect for class A, completely wrong for class B


You need to check which instances you give as training set in each case.