h2o.topN: H2O topN

Description Usage Arguments Value Examples

View source: R/frame.R

Description

Extract the top N percent of values of a column and return it in a H2OFrame.

Usage

1
h2o.topN(x, column, nPercent)

Arguments

x

an H2OFrame

column

is a column name or column index to grab the top N percent value from

nPercent

is a top percentage value to grab

Value

An H2OFrame with 2 columns. The first column is the original row indices, second column contains the topN values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(h2o)
h2o.init()

f <- "https://s3.amazonaws.com/h2o-public-test-data/bigdata/laptop/jira/TopBottomNRep4.csv.zip"
dataset <- h2o.importFile(f)
frameNames <- names(dataset)
nPercent <- c(1, 2, 3, 4)
nP <- nPercent[sample(1:length(nPercent), 1, replace = FALSE)]
colIndex <- sample(1:length(frameNames), 1, replace = FALSE)
h2o.topN(dataset, frameNames[colIndex], nP)

## End(Not run)

h2o documentation built on Jan. 4, 2022, 1:09 a.m.