根据 h2o 文档,我可以设置keep_cross_validation_predictions = T
从我的automl
模型中获取交叉验证预测。
但我无法让它工作。
使用文档中的这个例子
library(h2o)
h2o.init()
# Import a sample binary outcome train/test set into H2O
train <- h2o.importFile("https://s3.amazonaws.com/erin-data/higgs/higgs_train_10k.csv")
test <- h2o.importFile("https://s3.amazonaws.com/erin-data/higgs/higgs_test_5k.csv")
# Identify predictors and response
y <- "response"
x <- setdiff(names(train), y)
# For binary classification, response should be a factor
train[,y] <- as.factor(train[,y])
test[,y] <- as.factor(test[,y])
# Run AutoML for 20 base models (limited to 1 hour max runtime by default)
aml <- h2o.automl(x = x, y = y,
training_frame = train,
max_models = 20,
keep_cross_validation_predictions = TRUE,
seed = 1)
运行模型后,我尝试了
h2o.cross_validation_predictions(aml)
h2o.cross_validation_predictions(aml@leader)
h2o.cross_validation_holdout_predictions(aml)
h2o.cross_validation_holdout_predictions(aml@leader)
但它都不起作用。
编辑我正在使用最新的稳定版 3.24.02