[Spark-3525] Adding gradient boosting

use mean() directly.