Skip to content

Commit

Permalink
PUBDEV-2549 Fix h2o.summary() quantiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ludi committed Jan 23, 2016
1 parent 5084df2 commit 4b818f5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions h2o-r/h2o-package/R/frame.R
Original file line number Diff line number Diff line change
Expand Up @@ -1662,12 +1662,11 @@ h2o.summary <- function(object, factors=6L, ...) {
if( !(is.null(col.sum$maxs) || length(col.sum$maxs) == 0L) ) cmax <- max(col.sum$maxs,na.rm=TRUE) # set the max
if( !(is.null(col.sum$mean)) ) cmean<- col.sum$mean # set the mean

# 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# new double[]{0.001, 0.01, 0.1, 0.2, 0.25, 0.3, 1.0 / 3.0, 0.4, 0.5, 0.6, 2.0 / 3.0, 0.7, 0.75, 0.8, 0.9, 0.99, 0.999}));
if( !is.null(col.sum$percentiles) ){# set the 1st quartile, median, and 3rd quartile
c1Q <- col.sum$percentiles[5] # p=.25 col.rest$frames[[1]]$default_percentiles == c(0.001, 0.01, 0.1, 0.25, 0.333, 0.5, 0.666, 0.75, 0.9, 0.99, 0.999)
cmedian <- col.sum$percentiles[9] # p=.5
c3Q <- col.sum$percentiles[13] # p=.75
quantiles <- h2o.quantile(object[col.sum$label],c(.25,.5,.75)) # set the 1st quartile, median, and 3rd quartile
if( !is.null(quantiles) ){
c1Q <- quantiles[1]
cmedian <- quantiles[2]
c3Q <- quantiles[3]
}

missing.count <- NULL
Expand Down

0 comments on commit 4b818f5

Please sign in to comment.