2017-08-02 209 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