Skip to content

Commit

Permalink
implement review sugestions, fix R print model
Browse files Browse the repository at this point in the history
  • Loading branch information
maurever committed Aug 16, 2023
1 parent fa5b011 commit 6475d32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions h2o-docs/src/product/data-science/upliftdrf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ Overall treatment effect metrics show how the uplift predictions look across the

The interpretation depends on concrete data meanings. We currently support only Bernoulli data distribution, so whether the treatment impacts the target value y=1 or not.

For example, we analyze data to determine if some medical help to recover from disease or not. We have patients in the treatment group and the control group. The target variable is if the medicine (treatment) helped recovery (y=1) or not (y=0). In this case:
For example, we want to analyze data to determine if some medical will help to recover from a disease or not. We have patients in the treatment group and the control group. The target variable is if the medicine (treatment) helped recovery (y=1) or not (y=0). In this case:
- positive ATE means the medicine helps with recovery in general
- negative ATE means the medicine does not help with recovery in general
- ATE equal or similar to zero means the medicine does not affect recovery in general
- ATE equal to or close to zero means the medicine does not affect recovery in general
- similar interpretation applies to ATT and ATC, the positive ATT is usually what scientists look for, but ATC is also an interesting metric (in an ideal case, positive both ATT and ATC say the treatment has an exact effect).

Custom metric example for Uplift DRF
Expand Down
3 changes: 3 additions & 0 deletions h2o-r/h2o-package/R/classes.R
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ setClass("H2OBinomialUpliftMetrics", contains="H2OModelMetrics")
#' @export
setMethod("show", "H2OBinomialUpliftMetrics", function(object) {
callNextMethod(object) # call to the super
cat("ATE: ", object@metrics$ate, "\n", sep="" )
cat("ATT: ", object@metrics$atc, "\n", sep="" )
cat("ATC: ", object@metrics$att, "\n", sep="" )
cat("Default AUUC: ", object@metrics$AUUC, "\n", sep="")
cat("All types of AUUC: ", "\n", sep="")
print(object@metrics$auuc_table)
Expand Down
2 changes: 2 additions & 0 deletions h2o-r/tests/testdir_algos/uplift/runit_uplift_smoke.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ test.uplift <- function() {
min_rows = 10,
nbins = 100,
seed = seed)

print(model)

# test model metrics
print("Test model metrics")
Expand Down

0 comments on commit 6475d32

Please sign in to comment.