[Spark-3525] Adding gradient boosting

change asInstanceOf[Int] to toInt