Rahulcs75
Rahulcs75

Reputation: 19

H2OGeneralizedLinearEstimator ERROR

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)

I am getting the following error:

H2OTypeError: Argument y should be a None | integer | string, got list ['count.value']

Upvotes: 1

Views: 447

Answers (1)

AvkashChauhan
AvkashChauhan

Reputation: 20576

You are passing response as list ['count.value'] and that is the problem. You just need to pass response as 'count.value', thats all, like as below:

response1 = 'count.value'

Upvotes: 1

Related Questions