Skip to content

Commit

Permalink
Fix make_metrics bug
Browse files Browse the repository at this point in the history
  • Loading branch information
maurever committed Aug 11, 2023
1 parent c1afde4 commit f271745
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions h2o-py/h2o/h2o.py
Original file line number Diff line number Diff line change
Expand Up @@ -2043,6 +2043,7 @@ def make_metrics(predicted, actual, domain=None, distribution=None, weights=None
if weights is not None:
params["weights_frame"] = weights.frame_id
if treatment is not None:
assert treatment.ncol == 1, "`treatment` frame should have exactly 1 column"
params["treatment_frame"] = treatment.frame_id
allowed_auuc_types = ["qini", "lift", "gain", "AUTO"]
assert auuc_type in allowed_auuc_types, "auuc_type should be "+(" ".join([str(type) for type in allowed_auuc_types]))
Expand Down
6 changes: 3 additions & 3 deletions h2o-r/h2o-package/R/models.R
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ h2o.make_metrics <- function(predicted, actuals, domain=NULL, distribution=NULL,
predicted <- .validate.H2OFrame(predicted, required=TRUE)
actuals <- .validate.H2OFrame(actuals, required=TRUE)
weights <- .validate.H2OFrame(weights, required=FALSE)
treatment <- .validate.H2OFrame(treatment, required=TRUE)
treatment <- .validate.H2OFrame(treatment, required=FALSE)
if (!is.character(auc_type)) stop("auc_type argument must be of type character")
if (!(auc_type %in% c("MACRO_OVO", "MACRO_OVR", "WEIGHTED_OVO", "WEIGHTED_OVR", "NONE", "AUTO"))) {
stop("auc_type argument must be MACRO_OVO, MACRO_OVR, WEIGHTED_OVO, WEIGHTED_OVR, NONE, AUTO")
Expand All @@ -1157,8 +1157,8 @@ h2o.make_metrics <- function(predicted, actuals, domain=NULL, distribution=NULL,
if (auuc_nbins < -1 || auuc_nbins == 0) {
stop("auuc_nbins must be -1 or higher than 0.")
}
params$auuc_type = auuc_type
params$auuc_nbins = auuc_nbins
params$auuc_type <- auuc_type
params$auuc_nbins <- auuc_nbins
}
params$domain <- domain
params$distribution <- distribution
Expand Down

0 comments on commit f271745

Please sign in to comment.