-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[python-package] remove 'fobj' in favor of passing custom objective f…
…unction in params (fixes #3244) (#5052) * feat: support custom metrics in params * feat: support objective in params * test: custom objective and metric * fix: imports are incorrectly sorted * feat: convert eval metrics str and set to list * feat: convert single callable eval_metric to list * test: single callable objective in params Signed-off-by: Miguel Trejo <[email protected]> * feat: callable fobj in basic cv function Signed-off-by: Miguel Trejo <[email protected]> * test: cv support objective callable Signed-off-by: Miguel Trejo <[email protected]> * fix: assert in cv_res Signed-off-by: Miguel Trejo <[email protected]> * docs: objective callable in params Signed-off-by: Miguel Trejo <[email protected]> * recover test_boost_from_average_with_single_leaf_trees Signed-off-by: Miguel Trejo <[email protected]> * linters fail Signed-off-by: Miguel Trejo <[email protected]> * remove metrics helper functions Signed-off-by: Miguel Trejo <[email protected]> * feat: choose objective through _choose_param_values Signed-off-by: Miguel Trejo <[email protected]> * test: test objective through _choose_param_values Signed-off-by: Miguel Trejo <[email protected]> * test: test objective is callabe in train Signed-off-by: Miguel Trejo <[email protected]> * test: parametrize choose_param_value with objective aliases Signed-off-by: Miguel Trejo <[email protected]> * test: cv booster metric is none Signed-off-by: Miguel Trejo <[email protected]> * fix: if string and callable choose callable Signed-off-by: Miguel Trejo <[email protected]> * test train uses custom objective metrics Signed-off-by: Miguel Trejo <[email protected]> * test: cv uses custom objective metrics Signed-off-by: Miguel Trejo <[email protected]> * refactor: remove fobj parameter in train and cv Signed-off-by: Miguel Trejo <[email protected]> * refactor: objective through params in sklearn API Signed-off-by: Miguel Trejo <[email protected]> * custom objective function in advanced_example Signed-off-by: Miguel Trejo <[email protected]> * fix whitespackes lint * objective is none not a particular case for predict method Signed-off-by: Miguel Trejo <[email protected]> * replace scipy.expit with custom implementation Signed-off-by: Miguel Trejo <[email protected]> * test: set num_boost_round value to 20 Signed-off-by: Miguel Trejo <[email protected]> * fix: custom objective default_value is none Signed-off-by: Miguel Trejo <[email protected]> * refactor: remove self._fobj Signed-off-by: Miguel Trejo <[email protected]> * custom_objective default value is None Signed-off-by: Miguel Trejo <[email protected]> * refactor: variables name reference dummy_obj Signed-off-by: Miguel Trejo <[email protected]> * linter errors * fix: process objective parameter when calling predict Signed-off-by: Miguel Trejo <[email protected]> * linter errors * fix: objective is None during predict call Signed-off-by: Miguel Trejo <[email protected]>
- Loading branch information
1 parent
fc0c8fd
commit 416ecd5
Showing
7 changed files
with
270 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.