microsoft / SynapseML

Simple and Distributed Machine Learning
http://aka.ms/spark
MIT License
5.04k stars 830 forks source link

[BUG]Unable to see the tuned hyperparameter from bestmodelinfo #1850

Open ayanbizz opened 1 year ago

ayanbizz commented 1 year ago

SynapseML version

0.9.4

System information

Describe the problem

I am running hyper-parameter tuning on LightGBM . Once the job completes I am trying to check the tuned hyper-parameter by calling getBestModelInfo() , but it is not printing the hyper-parmeter actualNumClasses: 2, featuresCol: TrainClassifier_e7a1f8587a87_features, featuresShapCol: , labelCol: is_opt_out_1_month, leafPredictionCol: , lightGBMBooster: com.microsoft.azure.synapse.ml.lightgbm.booster.LightGBMBooster@4e56743a, numIterations: 1000, predictionCol: prediction, probabilityCol: probability, rawPredictionCol: rawPrediction, startIteration: 0

Code to reproduce issue

static_params_dict = dict(
    objective="binary",
    labelCol=target,
    earlyStoppingRound=100,
    numThreads=20,
    numBatches=10,
    featuresCol="features",
    categoricalSlotNames=cat_features_indexed,
    learningRate=0.01,
    verbosity=1,
    isUnbalance=True,
    maxDepth=20,
    #numLeaves=20,
    #maxBin=255,
    numIterations=1000,
    boostingType="gbdt"
    #useBarrierExecutionMode=True
)
gbt = LightGBMClassifier().setParams(**static_params_dict)
smlmodels = [gbt]
mmlmodels = [TrainClassifier(model=model, labelCol=target) for model in smlmodels]
from synapse.ml.automl import *
paramBuilder = (
    HyperparamBuilder()
    .addHyperparam(gbt,gbt.numLeaves, DiscreteHyperParam([30, 40,70]))

)
searchSpace = paramBuilder.build()
randomSpace = RandomSpace(searchSpace)
bestModel = TuneHyperparameters(
    evaluationMetric="precision",
    models=mmlmodels,
    numFolds=2,
    numRuns=len(mmlmodels) * 1,
    parallelism=1,
    paramSpace=randomSpace.space(),
    seed=0,
).fit(train_valid_sample_iteration)

print(bestModel.getBestModelInfo())

Other info / logs

No response

What component(s) does this bug affect?

What language(s) does this bug affect?

What integration(s) does this bug affect?

github-actions[bot] commented 1 year ago

Hey @ayanbizz :wave:! Thank you so much for reporting the issue/feature request :rotating_light:. Someone from SynapseML Team will be looking to triage this issue soon. We appreciate your patience.

ppruthi commented 1 year ago

Tagging @svotaw as the bug is related to lightgbm

svotaw commented 1 year ago

adding @mhamilton723 to help triage. I don't think this has to do with LightGBM. It appears to be more an issue with HyperParameterTuning (I think).