Compute the Discrete Cosine Transform of every row in the H2OFrame

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))
# }