-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] change metric and set default metric (#5)
* deduplicated key * change default metric * change example name * change optimizer and rektgbm * change metric add params
- Loading branch information
Showing
7 changed files
with
83 additions
and
24 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from typing import Any, Dict | ||
|
||
from rektgbm.base import MethodName | ||
from rektgbm.objective import ObjectiveName | ||
|
||
|
||
def set_additional_params( | ||
objective: ObjectiveName, | ||
method: MethodName, | ||
params: Dict[str, Any], | ||
) -> Dict[str, Any]: | ||
if objective == ObjectiveName.quantile: | ||
if method == MethodName.lightgbm and "quantile_alpha" in params.keys(): | ||
params["alpha"] = params.pop("quantile_alpha") | ||
elif method == MethodName.xgboost and "alpha" in params.keys(): | ||
params["quantile_alpha"] = params.pop("alpha") | ||
elif objective == ObjectiveName.huber: | ||
if method == MethodName.lightgbm and "huber_slope" in params.keys(): | ||
params["alpha"] = params.pop("quantile_alpha") | ||
elif method == MethodName.xgboost and "alpha" in params.keys(): | ||
params["huber_slope"] = params.pop("alpha") | ||
return params |
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