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.
This function does not return the correct sequence:
The following function should return the equivalent of
cumsum(c(10, 2, 2, 2, 2, 2)) but actually returns the equivalent of
cumsum(c(2, 2, 2, 2, 2, 2)).
Sometimes ignoring a line in the middle of a function is of course undesirable behavior! I suspect a problem with how the element insert is being cached or sent to h2o. I would describe this as a major bug, because it results in the function working in an undocumented manner with unpredictable results without any warnings.
This function does not return the correct sequence: The following function should return the equivalent of cumsum(c(10, 2, 2, 2, 2, 2)) but actually returns the equivalent of cumsum(c(2, 2, 2, 2, 2, 2)).
test_fn <- function() { requireNamespace("h2o") seq.hex <- h2o::h2o.rep_len(2, length.out = 6) seq.hex[1,"C1"] <- 10 out.hex <- h2o::h2o.cumsum(x = seq.hex, axis = 0)
return(out.hex) } test_fn()
It appears to be "forgetting" the line seq.hex[1, "C1"] <- 10. Adding another step makes it "remember" and return the correct output:
test_fn <- function() { requireNamespace("h2o") seq.hex <- h2o::h2o.rep_len(2, length.out = 6) seq.hex[1,"C1"] <- 10 out.hex <- h2o::h2o.cumsum(x = seq.hex, axis = 0)
sum(seq.hex) # need this or something similar, such as print(seq.hex), to make this function work.
return(out.hex) } test_fn() # correctly returns 10, 12, 14, 16, 18, 20
Sometimes ignoring a line in the middle of a function is of course undesirable behavior! I suspect a problem with how the element insert is being cached or sent to h2o. I would describe this as a major bug, because it results in the function working in an undocumented manner with unpredictable results without any warnings.
Running on R 3.6.2 with h2o 3.28.1.1.