H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
The R apply method shows that you can pass optional arguments apply(X, MARGIN, FUN, ...)
where … = optional arguments to FUN. but there is a bug that doesn't allow you to pass optional arguments to FUN.
The following code demonstrate the issue
basically this works
{code}
library(h2o)
h2o.init()
df <- data.frame( AGE = c(9,7,33,84,86,25))
df_A.hex <- as.h2o( df, 'df_A.hex' )
simple_spline <- function(x) { min(max(x-12,0),12-24) }
print(apply(df_A.hex, 1, simple_spline))```
{code}
but this doesn’t work
{code}
simple_spline <- function( x, L, U ) min( max(x-L,0), U-L)
print(apply(df_A.hex, 1, simple_spline))
{code}
it errors out with
{code}
[1] "Lookup failed to find min"
Error in .process.stmnt(stmnt, formalz, envs) :
Don't know what to do with statement: min
{code}
Original [issue|https://stackoverflow.com/questions/52230318/r-function-not-evaluating-properly-on-h2o-dataset] posted by SO user.
The R
apply
method shows that you can pass optional argumentsapply(X, MARGIN, FUN, ...)
where… = optional arguments to FUN.
but there is a bug that doesn't allow you to pass optional arguments to FUN.The following code demonstrate the issue
basically this works {code} library(h2o) h2o.init() df <- data.frame( AGE = c(9,7,33,84,86,25)) df_A.hex <- as.h2o( df, 'df_A.hex' ) simple_spline <- function(x) { min(max(x-12,0),12-24) } print(apply(df_A.hex, 1, simple_spline))``` {code}
but this doesn’t work {code} simple_spline <- function( x, L, U ) min( max(x-L,0), U-L) print(apply(df_A.hex, 1, simple_spline)) {code}
it errors out with {code} [1] "Lookup failed to find min" Error in .process.stmnt(stmnt, formalz, envs) : Don't know what to do with statement: min {code}