[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.
As I said in the other PR which included a Predict class, I really do not think that an entire class for holding predictions is needed or helpful.  The InformationGainStats can hold the prediction information, even if the InformationGainStats.gain value is set to Double.MinValue (for an invalid split).