h2o.ensemble错误(x = x,y = y,training_frame = train,family = family,:family = gamma要求正输入反应 回溯:H2o.ensemble:family < - “gaussian”,family = gamma的错误需要肯定的响应
- h2o.ensemble(X = X,Y = Y,training_frame =火车,家族=家庭, 学习者=学习者,metalearner = metalearner,cvControl =列表(V = 5。 。shuffle = TRUE))
- stop(“family = gamma requires a positive respone”)
效应初探 “y” 为与两个负和正values.`
代码:
## Load required packages
library(h2o)
library(h2oEnsemble)
h2o.init(nthreads = -1, max_mem_size = "8G")
data <- h2o.importFile('./input/df_train.csv')
# Partition the data into train and test sets
splits <- h2o.splitFrame(data, seed = 1)
train <- splits[[1]]
test <- splits[[2]]
# Identify response and predictor variables
y <- "logerror"
x <- setdiff(colnames(data), c(y, "parcelid", "transactiondate"))
print(x)
# Specify the base learner library & the metalearner
learner <- c("h2o.glm.wrapper", "h2o.randomForest.wrapper",
"h2o.xgboost.wrapper",
"h2o.gbm.wrapper", "h2o.deeplearning.wrapper")
metalearner <- "h2o.glm.wrapper"
family <- "gaussian"
# Train the ensemble using 5-fold CV to generate level-one data
fit <- h2o.ensemble(x = x, y = y,
training_frame = train,
family = family,
learner = learner,
metalearner = metalearner,
cvControl = list(V = 5, shuffle = TRUE))
# Evaluate performance on a test set
perf <- h2o.ensemble_performance(fit, newdata = test)
perf
请发布一个完全可重复的代码片段,您正在使用的h2o的版本并包含错误消息。 – Lauren
h2oEnsemble R包H2O-3 版本:0.2.0,H2O簇版本:3.10.5.3 – danieleewww