H2OGeneralizedLinearEstimator ERROR

时间:2017-09-11 10:47:43

标签: h2o

import h2o

from h2o.estimators.gbm import H2OGradientBoostingEstimator
from h2o.estimators.deeplearning import H2ODeepLearningEstimator
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
h2o.init()

inputFile = h2o.import_file("SQLBlocked.csv")

inputFile['cat'] = inputFile['cat'].asfactor()
inputFile['entityN'] = inputFile['entityN'].asfactor()
inputFile['expectedT'] = inputFile['expectedT'].asfactor()
inputFile['u_play'] = inputFile['u_play'].asfactor()
inputFile['sub'] = inputFile['sub'].asfactor()

predictors = ["attempts", "cat", "entityN", "expectedT", "u_play", "sub"]
response1 = ['count.value']

inputFile.types
model = H2OGeneralizedLinearEstimator()
model.train(predictors, response1, training_frame = inputFile)

我收到以下错误:

  

H2OTypeError:参数y应该是None |整数|字符串,得到列表[' count.value']

1 个答案:

答案 0 :(得分:1)

您将回复作为列表[' count.value'],这就是问题所在。您只需要将响应作为' count.value'传递给所有人,如下所示:

response1 =' count.value'