2021年3月7日星期日

Error message: Error in Filter(function(mm) { : subscript out of bounds when working with h2o

I am trying to run the following models:

h2o.init()  train_h2o_df <- as.h2o(Cleaner_Train)  test_h2o_df <- as.h2o(Cleaner_Test)  y <- "SalePrice"  x <- setdiff(names(train_h2o_df), y)  nfolds <- 5    h2o_boosted <- h2o.gbm(x = x,                    y = y,                    training_frame = train_h2o_df,                    nfolds = nfolds,                    keep_cross_validation_predictions = TRUE,                    seed = 5)  h2o_randomF <- h2o.randomForest(x = x,                            y = y,                            training_frame = train_h2o_df,                            nfolds = nfolds,                            keep_cross_validation_predictions = TRUE,                            seed = 5)  ensemble_model <- h2o.stackedEnsemble(x = x,                                        y = y,                                        metalearner_algorithm="drf",                                        training_frame = train_h2o_df,                                        base_models = list(h2o_boosted, h2o_randomF))  

This works fine until I try to predict on ensemble_model:

Ensemble_Predict <- h2o.performance(ensemble_model, newdata = test_h2o_df)  

I get this error:

Error in Filter(function(mm) { : subscript out of bounds  

Another thread suggested that I update my h2o to the most recent version. I successfully did that, but the error still remains. I really have no idea as to what the issue is. My data works with all other standalone models, h2o seems to be the issue. Any help here is greatly appreciated.

https://stackoverflow.com/questions/66523163/error-message-error-in-filterfunctionmm-subscript-out-of-bounds-when-wor March 08, 2021 at 09:06AM

没有评论:

发表评论