[SPARK-2207][SPARK-3272]Add minimum information gain and minimum instances per node as training parameters for decision tree.

These two parameters can act as early stop rules to do pre-pruning. When a split cause cause left or right child to have less than `minInstancesPerNode` or has less information gain than `minInfoGain`, current node will not be split by this split.

When there is no possible splits that satisfy requirements, there is no useful information gain stats, but we still need to calculate the predict value for current node. So I separated calculation of predict from calculation of information gain, which can also save computation when the number of possible splits is large. Please see [SPARK-3272](https://issues.apache.org/jira/browse/SPARK-3272) for more details.

CC: @mengxr @manishamde @jkbradley, please help me review this, thanks.
I think you could avoid explicitly checking for invalidInformationGainStats since the gain is Double.minValue.  At the very end of the maxBy calls, you could then check to see if the information gain is Double.minValue, in which case we know that no split is worth doing.  That should simplify the code here and in the other maxBy calls below.