H2O Deep Learning默认运行回归,即使我确保目标变量是一个因子(只有两个级别)。有关如何解决此问题的任何线索?
以下是代码:
dnn_mod <-
h2o.deeplearning(x = 2:321, # column numbers for predictors
y = 322, # column number for label
training_frame = sdcs_data, # data in H2O format
activation = "TanhWithDropout", # or 'Tanh'
input_dropout_ratio = 0.2, # % of inputs dropout
hidden_dropout_ratios = c(0.3,0.3,0.3), # % for nodes dropout
balance_classes = FALSE,
hidden = c(150,150,150),
epochs = 500,
#standardize = TRUE,
epsilon = 1.0e-5,
loss = "CrossEntropy",
stopping_rounds = 50,
stopping_metric = "AUC")
#classification = TRUE)
答案 0 :(得分:2)
如果要运行分类,则必须将响应变量编码为&#34;因子&#34; (又名&#34; enum&#34;)类型。请参阅R code example中的H2O Deep Learning booklet。所有H2O算法都是如此。