How to extract best parameters from a CrossValidatorModel

后端 未结 11 733
轮回少年
轮回少年 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

    To print everything in paramMap, you actually don't have to call parent:

    cvModel.bestModel.extractParamMap()
    

    To answer OP's question, to get a single best parameter, for example regParam:

    cvModel.bestModel.extractParamMap().apply(cvModel.bestModel.getParam("regParam"))
    

提交回复
热议问题