H2OGeneralizedLinearEstimator() - 预测误差

2024-03-25

我正在尝试使用 H2OGeneralizedLinearEstimator 函数预测 Kaggle comp 中的测试时间。模型在第 3 行正常训练,指标也都很合理。然而,当我进入预测步骤时,尽管测试数据帧与训练数据帧匹配,但我还是收到错误。

以前有人见过这个错误吗?

 h2o_glm = H2OGeneralizedLinearEstimator()

 h2o_glm.train(training_frame=train_h2o,y='y')

 h2o_glm_predictions = h2o_glm.predict(test_data=test_h2o).as_data_frame()

 test_pred = pd.read_csv('test.csv')[['ID']]
 test_pred['y'] = h2o_glm_predictions
 test_pred.to_csv('h2o_glm_predictions.csv',index=False)

glm 模型构建进度:|████████████████████████████████████████████ ███| 100%

glm prediction progress: | (failed)

OSError Traceback (most recent call last) in () 3 h2o_glm.train(training_frame=train_h2o,y='y') 4 ----> 5 h2o_glm_predictions = h2o_glm.predict(test_data=test_h2o).as_data_frame() 6 7 test_pred = pd.read_csv('test.csv')[['ID']]

/Applications/anaconda/lib/python3.6/site-packages/h2o/model/model_base.py in predict(self, test_data) 130 j = H2OJob(h2o.api("POST /4/Predictions/models/%s/frames/%s" % (self.model_id, test_data.frame_id)), 131 self._model_json["algo"] + " prediction") --> 132 j.poll() 133 return h2o.get_frame(j.dest_key) 134

/Applications/anaconda/lib/python3.6/site-packages/h2o/job.py in poll(self) 71 if (isinstance(self.job, dict)) and ("stacktrace" in list(self.job)): 72 raise EnvironmentError("Job with key {} failed with an exception: {}\nstacktrace: " ---> 73 "\n{}".format(self.job_key, self.exception, self.job["stacktrace"])) 74 else: 75 raise EnvironmentError("Job with key %s failed with an exception: %s" % (self.job_key, self.exception))

OSError:带有密钥的作业 $03017f00000132d4ffffffff$_868312f4c32f683871930a1145c1476a 失败 有一个例外:来自 /127.0.0.1:54321 的 DistributedException: 'null', 由 java.lang.ArrayIndexOutOfBoundsException 堆栈跟踪引起: 来自 /127.0.0.1:54321 的 DistributedException:'null',由以下原因引起 java.lang.ArrayIndexOutOfBoundsException 位于 水.MRTask.getResult(MRTask.java:478) 在 水.MRTask.getResult(MRTask.java:486) 在 水.MRTask.doAll(MRTask.java:390) 在 水.MRTask.doAll(MRTask.java:396) 在 hex.glm.GLMModel.predictScoreImpl(GLMModel.java:1215)在 hex.Model.score(Model.java:1077) 在 water.api.ModelMetricsHandler$1.compute2(ModelMetricsHandler.java:351) 在水.H2O$H2OCountedCompleter.compute(H2O.java:1349) 在 jsr166y.CountedCompleter.exec(CountedCompleter.java:468) 在 jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) 在 jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) 在 jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)在 jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) 引起 作者:java.lang.ArrayIndexOutOfBoundsException


总结上面的评论,当前的解决方案是向test_data框架。然而,这是一个应该修复的错误。 JIRA 是here https://0xdata.atlassian.net/browse/PUBDEV-4659.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

H2OGeneralizedLinearEstimator() - 预测误差 的相关文章

随机推荐