This Pull Request introduces changes that address the parameter naming inconsistency between max_leaves and max_leaf_runodes highlighted in issue #1298. The modification ensures backward compatibility and aims to reduce confusion for FLAML users by aligning its parameters with the scikit-learn naming convention.
Changes Made
The code now checks for both max_leaves and max_leaf_nodes in the parameter list.
If max_leaves is provided, it is internally translated to max_leaf_nodes.
max_leaf_nodes takes precedence if both parameters are provided.
If only max_leaves is present, its value will be reassigned to max_leaf_nodes, and the max_leaves parameter will be removed from the parameters.
All references in the documentation and example codes have been updated to reflect this change.
Motivation
The aim is to promote consistency across the user interface, preserve functionality, and ensure that existing scripts using FLAML do not encounter unexpected behavior due to parameter naming discrepancies.
Related Issue
Closes #1298
Documentation
Updated the FLAML documentation to reflect changes in parameter usage.
The https://microsoft.github.io/FLAML/docs/Contribute guidelines were followed to update and test the documentation changes locally.
Tests
Added tests to verify that the new parameter handling is functioning as expected.
Ensured that existing tests pass with the new changes.
Checks
[ ] All linting and automated checks have passed.
[ ] This PR has been reviewed and approved by a maintainer.
Acknowledgements
Special thanks to the FLAML community and the contributors who discussed and provided feedback on this issue.
Overview
This Pull Request introduces changes that address the parameter naming inconsistency between
max_leaves
andmax_leaf_runodes
highlighted in issue #1298. The modification ensures backward compatibility and aims to reduce confusion for FLAML users by aligning its parameters with thescikit-learn
naming convention.Changes Made
max_leaves
andmax_leaf_nodes
in the parameter list.max_leaves
is provided, it is internally translated tomax_leaf_nodes
.max_leaf_nodes
takes precedence if both parameters are provided.max_leaves
is present, its value will be reassigned tomax_leaf_nodes
, and themax_leaves
parameter will be removed from the parameters.Motivation
The aim is to promote consistency across the user interface, preserve functionality, and ensure that existing scripts using FLAML do not encounter unexpected behavior due to parameter naming discrepancies.
Related Issue
Closes #1298
Documentation
https://microsoft.github.io/FLAML/docs/Contribute
guidelines were followed to update and test the documentation changes locally.Tests
Checks
Acknowledgements
Special thanks to the FLAML community and the contributors who discussed and provided feedback on this issue.