Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-16433 Fixed misc small errors in GAM, GLM, ModelSelection toolboxes [nocheck] #16435

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 0 additions & 6 deletions h2o-bindings/bin/custom/python/gen_gam.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ def update_param(name, param):


def class_extensions():
def _additional_used_columns(self, parms):
"""
:return: Gam columns if specified.
"""
return parms["gam_columns"]

def _summary(self):
"""Return a detailed summary of the model."""
model = self._model_json["output"]
Expand Down
6 changes: 0 additions & 6 deletions h2o-py/h2o/estimators/gam.py
Original file line number Diff line number Diff line change
Expand Up @@ -1595,12 +1595,6 @@ def gainslift_bins(self, gainslift_bins):

Lambda = deprecated_property('Lambda', lambda_)

def _additional_used_columns(self, parms):
"""
:return: Gam columns if specified.
"""
return parms["gam_columns"]

def _summary(self):
"""Return a detailed summary of the model."""
model = self._model_json["output"]
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-py/tests/testdir_algos/glm/pyunit_benign_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def test_benign():
training_data = h2o.import_file(pyunit_utils.locate("smalldata/logreg/benign.csv"))

training_data[3] = training_data[3].asfactor()
Y = 3
X = [0, 1, 2, 4, 5, 6, 7, 8, 9, 10]

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