#r #h2o
#r #h2o
Вопрос:
Я хотел бы объединить две уже составные модели, созданные с помощью h2o::h2o.automl
функции.
# Fit models
all_models_h2o_s1 <- h2o::h2o.automl(y = "sr_elec",
training_frame = df_train_d_h2o,
max_models = 2,
max_runtime_secs = 60*60*24, # 1 day
stopping_metric = "deviance",
sort_metric = "deviance",
seed = 1, # this is the only diference
nfolds = 5,
keep_cross_validation_predictions = TRUE)
all_models_h2o_s2 <- h2o::h2o.automl(y = "sr_elec",
training_frame = df_train_d_h2o,
max_models = 2,
max_runtime_secs = 60*60*24, # 1 day
stopping_metric = "deviance",
sort_metric = "deviance",
seed = 2, # this is the only diference
nfolds = 5,
keep_cross_validation_predictions = TRUE)
# Get best models
model_l1_s1 <- all_models_h2o_s1@leader
model_l1_s2 <- all_models_h2o_s2@leader
# Model types
model_l1_s1@model_id # StackedEnsemble_AllModels_AutoML_20190327_141553
model_l1_s2@model_id # StackedEnsemble_AllModels_AutoML_20190327_142026
# Ensemble models
ensemble <- h2o::h2o.stackedEnsemble(y = "sr_elec",
training_frame = df_train_d_h2o,
base_models = list(model_l1_s1, model_l1_s2))
Приведенная ошибка:
water.exceptions.H2OIllegalArgumentException: Base model does not use cross-validation: 0
water.exceptions.H2OIllegalArgumentException: Base model does not use cross-validation: 0
at hex.StackedEnsembleModel.checkAndInheritModelProperties(StackedEnsembleModel.java:368)
at hex.ensemble.StackedEnsemble$StackedEnsembleDriver.computeImpl(StackedEnsemble.java:234)
at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:218)
at water.H2O$H2OCountedCompleter.compute(H2O.java:1395)
at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Error: water.exceptions.H2OIllegalArgumentException: Base model does not use cross-validation: 0
Версия:
packageVersion(pkg = "h2o")
[1] ‘3.22.1.1’
R.Version()
$platform
[1] "x86_64-w64-mingw32"
$arch
[1] "x86_64"
$os
[1] "mingw32"
$system
[1] "x86_64, mingw32"
$status
[1] ""
$major
[1] "3"
$minor
[1] "5.3"
$year
[1] "2019"
$month
[1] "03"
$day
[1] "11"
$`svn rev`
[1] "76217"
$language
[1] "R"
$version.string
[1] "R version 3.5.3 (2019-03-11)"
$nickname
[1] "Great Truth"
Ответ №1:
Нет, в настоящее время это не поддерживается, но я создал тикет для его поддержки в будущем. Я не пробовал это, но вы могли бы заставить это работать, если вы используете blending_frame
аргумент вместо того, чтобы полагаться на базовые модели с перекрестной проверкой.