Train classifier on balanced dataset and apply on imbalanced dataset? I have a labelled training dataset DS1 with 1000 entries. The targets (True/False) are nearly balanced. With sklearn, I have tried several algorithms, of which the GradientBoostingClassifier works best with F-Score ~0.83.

Now, I have to apply the trained classifier on an unlabelled dataset DS2 with ~ 5 million entries (and same features). However, for DS2, the target distribution is expected to be highly unbalanced.

Is this a problem? Will the model reproduce the trained target distribution from DS1 when applied on DS2? 

If yes, would another algorithm be more robust?
Is this a problem?


No. not at all.


  Will the model reproduce the trained target distribution from DS1 when
  applied on DS2?


No, not necessarily. If 


Balanced set DS1 is a good representative of imbalanced (target) set DS2, and
Classes are well-separated (pointed out by @BenReiniger), which holds easier in higher dimensions,


then model will generate labels with a ratio close to imbalanced DS2 not balanced DS1. Here is a visual example (drawn by myself):



As you see, in the good training set, predictions resemble the real-world ratio, even though model is trained on a balanced set, of course, if classifier does a good job of finding the decision boundaries.