SynapseML icon indicating copy to clipboard operation
SynapseML copied to clipboard

Question about TuneHyperparameters

Open chibberto opened this issue 7 years ago • 2 comments

Hi, I have a question about the TuneHyperparameters function in the python version of MMLSpark. Currently I'm doing something along the lines of

TuneHyperparameters(
            evaluationMetric="AUC", 
            models=mmlmodels, 
            numFolds=3,
            numRuns=30, 
            paramSpace=randomSpace.space(), seed=123)

whereby some of the models that are being used are mmlspark's lightgbm implementation, using a weightCol when setting up the LightGBMClassifier. Am I correct in thinking that TuneHyperparameters uses the built in spark ML evaluators, and currently this does not support weighting in the evaluator? Therefore, TuneHyperparameters will not optimise on the weighted AUC, but the unweighted AUC? Is there any way around this currently? (I see there has been some work to create some weighted evaluators in spark ML but not released yet) Thanks, Chris

chibberto avatar Mar 01 '19 15:03 chibberto

"uses the built in spark ML evaluators, and currently this does not support weighting in the evaluator" currently it uses ComputeModelStatistics, which is our own optimized implementation:

https://github.com/Azure/mmlspark/blob/master/src/tune-hyperparameters/src/main/scala/TuneHyperparameters.scala#L140

It would be good to allow the user to specify any custom evaluator as well, I think that should be added in the future as part of this issue.

Currently the spark ML evaluators and our ComputeModelStatistics do not support a weight col, but in spark 3.0 the evaluators should support it.

"Therefore, TuneHyperparameters will not optimise on the weighted AUC, but the unweighted AUC?" yes, that's something that should be fixed. I don't think it would be too difficult to add weight column to ComputeModelStatistics in MMLSpark package, but if you want to use spark ML's v3.0 evaluators that may take some time unless you can get a custom build - as I understand the release will be sometime later this year.

imatiach-msft avatar Mar 01 '19 22:03 imatiach-msft

Ok, thanks for your fast response as always!

chibberto avatar Mar 04 '19 08:03 chibberto