How to extract best parameters from a CrossValidatorModel

后端 未结 11 714
轮回少年
轮回少年 2020-12-13 02:31

I want to find the parameters of ParamGridBuilder that make the best model in CrossValidator in Spark 1.4.x,

In Pipeline Example in Spark documentation,

11条回答
  •  独厮守ぢ
    2020-12-13 02:57

    Building in the solution of @macfeliga, a single liner that works for pipelines:

    cvModel.bestModel.asInstanceOf[PipelineModel]
        .stages.foreach(stage => println(stage.extractParamMap))
    

提交回复
热议问题