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