microsoft / microsoft/SynapseML

[BUG]Unable to see the tuned hyperparameter from bestmodelinfo

Open
#1,850 3 comments 1 reaction 3 assignees View on GitHub

@imatiach-msft is already working on this.

Since Aug 18, 2023.

area/lightgbm bug
Dominant language
Scala
Stars
5.2k
Forks
868
Avg merge
22h 9m
Merged PRs (30d)
45

Description

### SynapseML version

0.9.4

### System information

- **Language version** (e.g. python 3.8, scala 2.12):
- **Spark Version** (e.g. 3.2.3):
- **Spark Platform** (e.g. Synapse, Databricks):

### 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?

- [ ] `area/cognitive`: Cognitive project
- [ ] `area/core`: Core project
- [ ] `area/deep-learning`: DeepLearning project
- [x] `area/lightgbm`: Lightgbm project
- [ ] `area/opencv`: Opencv project
- [ ] `area/vw`: VW project
- [ ] `area/website`: Website
- [ ] `area/build`: Project build system
- [ ] `area/notebooks`: Samples under notebooks folder
- [ ] `area/docker`: Docker usage
- [ ] `area/models`: models related issue

### What language(s) does this bug affect?

- [ ] `language/scala`: Scala source code
- [X] `language/python`: Pyspark APIs
- [ ] `language/r`: R APIs
- [ ] `language/csharp`: .NET APIs
- [ ] `language/new`: Proposals for new client languages

### What integration(s) does this bug affect?

- [ ] `integrations/synapse`: Azure Synapse integrations
- [ ] `integrations/azureml`: Azure ML integrations
- [ ] `integrations/databricks`: Databricks integrations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.