2017-09-11 1 views
1
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) 

Je reçois l'erreur suivante:H2OGeneralizedLinearEstimator erreur

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

Répondre

1

Vous passez réponse liste [ 'count.value'] et qui est le problème. Vous avez juste besoin de passer une réponse comme « count.value », c'est tout, comme ci-dessous:

response1 = « count.value »

+1

grâce apparier, cela a fonctionné :-) – Rahulcs75