Skip to content

Commit

Permalink
Add GBM to the weaklearners
Browse files Browse the repository at this point in the history
  • Loading branch information
valenad1 committed Sep 19, 2023
1 parent 2722f60 commit 1fc5898
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion h2o-algos/src/main/java/hex/schemas/AdaBoostV3.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static final class AdaBoostParametersV3 extends ModelParametersSchemaV3<A
@API(help = "Number of AdaBoost weak learners.", gridable = true)
public int n_estimators;

@API(help = "Choose a weak learner type. Defaults to DRF.", gridable = true, values = {"AUTO", "DRF", "GLM"})
@API(help = "Choose a weak learner type. Defaults to DRF.", gridable = true, values = {"AUTO", "DRF", "GLM", "GBM"})
public AdaBoostModel.Algorithm weak_learner;

@API(help="Learning rate (from 0.0 to 1.0)", gridable = true)
Expand Down
8 changes: 4 additions & 4 deletions h2o-py/h2o/estimators/adaboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self,
categorical_encoding="auto", # type: Literal["auto", "enum", "one_hot_internal", "one_hot_explicit", "binary", "eigen", "label_encoder", "sort_by_response", "enum_limited"]
weights_column=None, # type: Optional[str]
n_estimators=50, # type: int
weak_learner="auto", # type: Literal["auto", "drf", "glm"]
weak_learner="auto", # type: Literal["auto", "drf", "glm", "gbm"]
learn_rate=0.5, # type: float
seed=-1, # type: int
):
Expand Down Expand Up @@ -64,7 +64,7 @@ def __init__(self,
:type n_estimators: int
:param weak_learner: Choose a weak learner type. Defaults to DRF.
Defaults to ``"auto"``.
:type weak_learner: Literal["auto", "drf", "glm"]
:type weak_learner: Literal["auto", "drf", "glm", "gbm"]
:param learn_rate: Learning rate (from 0.0 to 1.0)
Defaults to ``0.5``.
:type learn_rate: float
Expand Down Expand Up @@ -180,13 +180,13 @@ def weak_learner(self):
"""
Choose a weak learner type. Defaults to DRF.
Type: ``Literal["auto", "drf", "glm"]``, defaults to ``"auto"``.
Type: ``Literal["auto", "drf", "glm", "gbm"]``, defaults to ``"auto"``.
"""
return self._parms.get("weak_learner")

@weak_learner.setter
def weak_learner(self, weak_learner):
assert_is_type(weak_learner, None, Enum("auto", "drf", "glm"))
assert_is_type(weak_learner, None, Enum("auto", "drf", "glm", "gbm"))
self._parms["weak_learner"] = weak_learner

@property
Expand Down
6 changes: 3 additions & 3 deletions h2o-r/h2o-package/R/adaboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' you set weight = 0 for a row, the returned prediction frame at that row is zero and this is incorrect. To get
#' an accurate prediction, remove all rows with weight == 0.
#' @param n_estimators Number of AdaBoost weak learners. Defaults to 50.
#' @param weak_learner Choose a weak learner type. Defaults to DRF. Must be one of: "AUTO", "DRF", "GLM". Defaults to AUTO.
#' @param weak_learner Choose a weak learner type. Defaults to DRF. Must be one of: "AUTO", "DRF", "GLM", "GBM". Defaults to AUTO.
#' @param learn_rate Learning rate (from 0.0 to 1.0) Defaults to 0.5.
#' @param seed Seed for random numbers (affects certain parts of the algo that are stochastic and those might or might not be enabled by default).
#' Defaults to -1 (time-based random number).
Expand Down Expand Up @@ -57,7 +57,7 @@ h2o.adaBoost <- function(x,
categorical_encoding = c("AUTO", "Enum", "OneHotInternal", "OneHotExplicit", "Binary", "Eigen", "LabelEncoder", "SortByResponse", "EnumLimited"),
weights_column = NULL,
n_estimators = 50,
weak_learner = c("AUTO", "DRF", "GLM"),
weak_learner = c("AUTO", "DRF", "GLM", "GBM"),
learn_rate = 0.5,
seed = -1)
{
Expand Down Expand Up @@ -109,7 +109,7 @@ h2o.adaBoost <- function(x,
categorical_encoding = c("AUTO", "Enum", "OneHotInternal", "OneHotExplicit", "Binary", "Eigen", "LabelEncoder", "SortByResponse", "EnumLimited"),
weights_column = NULL,
n_estimators = 50,
weak_learner = c("AUTO", "DRF", "GLM"),
weak_learner = c("AUTO", "DRF", "GLM", "GBM"),
learn_rate = 0.5,
seed = -1,
segment_columns = NULL,
Expand Down

0 comments on commit 1fc5898

Please sign in to comment.