I am using version H2O 3.10.4.8.
library(h2o)
h2o.init(nthreads = -1)
df <- as.h2o(data.frame(x = 1:5, y = 11:15))
I am trying to understand how to use a function apply()in H2O.
The following works as expected:
h2o::apply(df, 2, mean)
h2o::apply(df, 2, sum)
h2o::apply(df, 2, function(x) {2*x + 1})
But this is not so:
h2o::apply(df, 2, sd)
Error returned:
[1] "Lookup failed to find is.H2OFrame"
Error in .process.stmnt(stmnt, formalz, envs) :
Don't know what to do with statement: is.H2OFrame x
I also thought that H2O actually uses its own functions to calculate, so the following should work:
h2o::apply(df, 2, h2o.mean)
h2o::apply(df, 2, h2o.sum)
h2o::apply(df, 2, h2o.sd)
But this is not so. The first two lines give the following error:
[1] "Lookup failed to find .newExpr"
Error in .process.stmnt(stmnt, formalz, envs) :
Don't know what to do with statement: .newExpr sd x na.rm
While in the third line the following error appears:
[1] "Lookup failed to find .newExpr"
Error in .process.stmnt(stmnt, formalz, envs) :
Don't know what to do with statement: .newExpr sd x na.rm
What happens and what things should I know when passing stuff to a FUN parameter in a function apply()? The documentation simply describes the FUN as "a function to be applied."