h2o.dct: Compute DCT of an H2OFrame

View source: R/frame.R

h2o.dctR Documentation

Compute DCT of an H2OFrame

Description

Compute the Discrete Cosine Transform of every row in the H2OFrame

Usage

h2o.dct(data, destination_frame, dimensions, inverse = FALSE)

Arguments

data

An H2OFrame object representing the dataset to transform

destination_frame

A frame ID for the result

dimensions

An array containing the 3 integer values for height, width, depth of each sample. The product of HxWxD must total up to less than the number of columns. For 1D, use c(L,1,1), for 2D, use C(N,M,1).

inverse

Whether to perform the inverse transform

Value

Returns an H2OFrame object.

Examples

## Not run: 
  library(h2o)
  h2o.init()
  df <- h2o.createFrame(rows = 1000, cols = 8 * 16 * 24,
                        categorical_fraction = 0, integer_fraction = 0, missing_fraction = 0)
  df1 <- h2o.dct(data = df, dimensions = c(8 * 16 * 24, 1, 1))
  df2 <- h2o.dct(data = df1, dimensions = c(8 * 16 * 24, 1, 1), inverse = TRUE)
  max(abs(df1 - df2))

  df1 <- h2o.dct(data = df, dimensions = c(8 * 16, 24, 1))
  df2 <- h2o.dct(data = df1, dimensions = c(8 * 16, 24, 1), inverse = TRUE)
  max(abs(df1 - df2))

  df1 <- h2o.dct(data = df, dimensions = c(8, 16, 24))
  df2 <- h2o.dct(data = df1, dimensions = c(8, 16, 24), inverse = TRUE)
  max(abs(df1 - df2))

## End(Not run)

h2o documentation built on May 29, 2024, 4:26 a.m.