Skip to content

Commit

Permalink
GH-16433: add changes to various algos to fix minor errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
wendycwong committed Oct 23, 2024
1 parent d0899f8 commit 6bf4950
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion h2o-algos/src/main/java/hex/gam/GAM.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public class GAM extends ModelBuilder<GAMModel, GAMModel.GAMParameters, GAMModel

@Override
public ModelCategory[] can_build() {
return new ModelCategory[]{ModelCategory.Regression};
return new ModelCategory[]{ModelCategory.Regression, ModelCategory.Binomial, ModelCategory.Multinomial,
ModelCategory.Ordinal};
}

@Override
Expand Down
6 changes: 4 additions & 2 deletions h2o-algos/src/main/java/hex/glm/GLM.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ public boolean isSupervised() {
@Override
public ModelCategory[] can_build() {
return new ModelCategory[]{
ModelCategory.Regression,
ModelCategory.Binomial,
ModelCategory.Regression,
ModelCategory.Binomial,
ModelCategory.Multinomial,
ModelCategory.Ordinal
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected double[] score0(double[] data, double[] preds) {

@Override
public Frame score(Frame fr, String destination_key, Job j, boolean computeMetrics, CFuncRef customMetricFunc) {
throw new UnsupportedOperationException("AnovaGLM does not support scoring on data. It only provide " +
throw new UnsupportedOperationException("ModelSelection does not support scoring on data. It only provide " +
"information on predictor relevance");
}

Expand Down
2 changes: 1 addition & 1 deletion h2o-algos/src/main/java/hex/schemas/ModelSelectionV3.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static final class ModelSelectionParametersV3 extends ModelParametersSche
"inverse", "tweedie", "ologit"}) //"oprobit", "ologlog": will be supported.
public GLMModel.GLMParameters.Link link;

@API(help = "double array to initialize fixed and random coefficients for HGLM, coefficients for GLM.",
@API(help = "Double array to initialize coefficients for GLM.",
gridable=true)
public double[] startval;

Expand Down
4 changes: 2 additions & 2 deletions h2o-py/h2o/estimators/model_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def __init__(self,
lambda_search is set to True, the conditional values above are 1E-8 and 1E-6 respectively.
Defaults to ``-1.0``.
:type gradient_epsilon: float
:param startval: double array to initialize fixed and random coefficients for HGLM, coefficients for GLM.
:param startval: Double array to initialize coefficients for GLM.
Defaults to ``None``.
:type startval: List[float], optional
:param prior: Prior probability for y==1. To be used only for logistic regression iff the data has been sampled
Expand Down Expand Up @@ -900,7 +900,7 @@ def gradient_epsilon(self, gradient_epsilon):
@property
def startval(self):
"""
double array to initialize fixed and random coefficients for HGLM, coefficients for GLM.
Double array to initialize coefficients for GLM.
Type: ``List[float]``.
"""
Expand Down
2 changes: 1 addition & 1 deletion h2o-r/h2o-package/R/modelselection.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#' (of -1.0) indicates: If lambda_search is set to False and lambda is equal to zero, the default value of
#' gradient_epsilon is equal to .000001, otherwise the default value is .0001. If lambda_search is set to True,
#' the conditional values above are 1E-8 and 1E-6 respectively. Defaults to -1.
#' @param startval double array to initialize fixed and random coefficients for HGLM, coefficients for GLM.
#' @param startval Double array to initialize coefficients for GLM.
#' @param prior Prior probability for y==1. To be used only for logistic regression iff the data has been sampled and the mean
#' of response does not reflect reality. Defaults to 0.
#' @param cold_start \code{Logical}. Only applicable to multiple alpha/lambda values. If false, build the next model for next set
Expand Down

0 comments on commit 6bf4950

Please sign in to comment.