Different outputs from Optuna best trial value and classifier output trained with best hyperparameters #5437
-
Datasplit:
I have used the code below for Optuna hyperparameter tuning:
Output:
Using the best hyperparameters from Optuna, I re-trianed the Code:
Output:
Now, you can see the best value from Optuna is my question is why the values are different here though the parameters are the same? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Could you share the minimal reproducible code with us? |
Beta Was this translation helpful? Give feedback.
-
Hi Kento,
I have added the Python file and the required data to the following drive
link.
https://drive.google.com/drive/folders/1wfj2dYV2MWwdER1sCuuTAHQ39QeE3IhT?usp=sharing
Thank you!
…On Thu, 9 May 2024 at 04:47, Kento Nozawa ***@***.***> wrote:
Could you share the minimal reproducible code with us?
—
Reply to this email directly, view it on GitHub
<#5437 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEBGRQBBZ2TOOGBQVEAENFDZBLPUJAVCNFSM6AAAAABHNI2HO2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TGNRSGUYTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Best Regards,
Mohammed Sabiya Sujith Ahamed
|
Beta Was this translation helpful? Give feedback.
-
Yes, that makes sense. The problem is fixed now.
Thanks, man!
…On Thu, 9 May 2024 at 17:18, Kento Nozawa ***@***.***> wrote:
Hi, I think this line should use the same name between dict's key and
optuna's param name. This inconsistency looks the root caues.
"learning_rate": trial.suggest_loguniform("alpha", 1e-8, 1.0),
In addition, objective and eval_metric are only specified in the
objective and not in the call of the last fitting with best params.
—
Reply to this email directly, view it on GitHub
<#5437 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEBGRQAKJPKPU4U3MUB7JE3ZBOHTHAVCNFSM6AAAAABHNI2HO2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TGNZQHEZDQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Best Regards,
Mohammed Sabiya Sujith Ahamed
|
Beta Was this translation helpful? Give feedback.
Hi, I think this line should use the same name between dict's key and optuna's param name. This inconsistency looks the root cause of the issue.
In addition,
objective
andeval_metric
are only specified in the objective and not in the call of the last fitting with best params.