2017-08-02 211 views
0

h2o.ensemble错误(x = x,y = y,training_frame = train,family = family,:family = gamma要求正输入反应 回溯:H2o.ensemble:family < - “gaussian”,family = gamma的错误需要肯定的响应

  1. h2o.ensemble(X = X,Y = Y,training_frame =火车,家族=家庭, 学习者=学习者,metalearner = metalearner,cvControl =列表(V = 5。 。shuffle = TRUE))
  2. 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 
+2

请发布一个完全可重复的代码片段,您正在使用的h2o的版本并包含错误消息。 – Lauren

+0

h2oEnsemble R包H2O-3 版本:0.2.0,H2O簇版本:3.10.5.3 – danieleewww

回答

0

这是当我添加支持,被介绍在h2oEnsemble v0.2.0中的错误额外的family值(伽马,泊松等)。我有fixed the bug并发布了h2oEnsemble v0.2.1;你可以找到一个链接,下载新的程序包here,或者使用下面R命令:

install.packages("https://h2o-release.s3.amazonaws.com/h2o-ensemble/R/h2oEnsemble_0.2.1.tar.gz", repos = NULL) 

在一个单独的说明,你的代码试图通过使用一个包装包括XGBoost模型,"h2o.xgboost.wrapper" - 没有XGBoost的内置包装尚未在h2oEnsemble包中使用,因此无法使用。我会在h2o 3.14.0.1发布后添加XGBoost包装。这应该在下一两周内发生。

+0

现在工作,谢谢 – danieleewww