Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wbo4958 committed Jun 14, 2024
1 parent 67ac15c commit 17bc414
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package ml.dmlc.xgboost4j.scala.spark.params

import com.google.common.base.CaseFormat
import org.apache.spark.ml.param.{BooleanParam, DoubleParam, FloatParam, IntParam, LongParam, Param, ParamValidators, Params}

import scala.collection.mutable
Expand All @@ -29,8 +28,7 @@ private[spark] trait ParamMapConversion extends NonXGBoostParams {
* @param xgboostParams XGBoost style parameters
*/
def xgboost2SparkParams(xgboostParams: Map[String, Any]): Unit = {
for ((paramName, paramValue) <- xgboostParams) {
val name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, paramName)
for ((name, paramValue) <- xgboostParams) {
params.find(_.name == name).foreach {
case _: DoubleParam =>
set(name, paramValue.toString.toDouble)
Expand Down

0 comments on commit 17bc414

Please sign in to comment.