Fix class weights in grid and randomized search - #3198
RAVasiliev wants to merge 4 commits into
Conversation
|
The macOS build failed during |
|
Thanks, this is a better fit for these tests. Replaced the sklearn generator with |
|
@andrey-khropov has imported your pull request. If you are a Yandex employee, you can view this diff. |
|
✅ This pull request is being closed because it has been successfully merged into our internal monorepository. |
Fixes #2392. Grid and randomized search reused the first candidate's class weights, so changing their order could change the result. This updates the weights for each candidate while keeping the quantized features cached. It also fixes the `use_weights=false` error when class weights are set. Weighted metrics remain the default. Tested on CPU/macOS ARM64: all 28 new regression cases fail before the fix and pass after it. All 12 existing search tests pass too. --- Pull Request resolved: #3198 commit_hash:e02213b36f4751c0c287f5a94a4ca58e30547b77
Fixes #2392.
Grid and randomized search reused the first candidate's class weights, so changing their order could change the result. This updates the weights for each candidate while keeping the quantized features cached. It also fixes the
use_weights=falseerror when class weights are set. Weighted metrics remain the default.Tested on CPU/macOS ARM64: all 28 new regression cases fail before the fix and pass after it. All 12 existing search tests pass too.