h2o.xgboost抛出空指针异常

时间:2018-05-01 21:27:18

标签: r dataframe h2o xgboost

我正在尝试在R中运行h2o.xgboost(),并且能够在3.14.0.3 version中成功使用它。但是,我最近更新到3.18.0.8版本,我收到了以下错误。我尝试了很多东西但却找不到原因。任何帮助将不胜感激。

错误:

DistributedException from localhost/127.0.0.1:54321: 'null', caused by java.lang.NullPointerException

DistributedException from localhost/127.0.0.1:54321: 'null', caused by java.lang.NullPointerException
    at water.MRTask.getResult(MRTask.java:478)
    at water.MRTask.getResult(MRTask.java:486)
    at water.MRTask.doAll(MRTask.java:390)
    at water.MRTask.doAll(MRTask.java:386)
    at ml.dmlc.xgboost4j.java.XGBoostScoreTask.runScoreTask(XGBoostScoreTask.java:45)
    at hex.tree.xgboost.XGBoostModel.makePreds(XGBoostModel.java:367)
    at hex.tree.xgboost.XGBoostModel.makeMetrics(XGBoostModel.java:343)
    at hex.tree.xgboost.XGBoostModel.makeMetrics(XGBoostModel.java:337)
    at hex.tree.xgboost.XGBoostModel.doScoring(XGBoostModel.java:387)
    at hex.tree.xgboost.XGBoost$XGBoostDriver.doScoring(XGBoost.java:470)
    at hex.tree.xgboost.XGBoost$XGBoostDriver.scoreAndBuildTrees(XGBoost.java:376)
    at hex.tree.xgboost.XGBoost$XGBoostDriver.buildModelImpl(XGBoost.java:335)
    at hex.tree.xgboost.XGBoost$XGBoostDriver.buildModel(XGBoost.java:262)
    at hex.tree.xgboost.XGBoost$XGBoostDriver.computeImpl(XGBoost.java:252)
    at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:206)
    at water.H2O$H2OCountedCompleter.compute(H2O.java:1263)
    at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
    at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
    at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
    at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
    at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Caused by: java.lang.NullPointerException
    at hex.tree.xgboost.XGBoostUtils.dense(XGBoostUtils.java:311)
    at hex.tree.xgboost.XGBoostUtils.convertChunksToDMatrix(XGBoostUtils.java:279)
    at ml.dmlc.xgboost4j.java.XGBoostScoreTask.map(XGBoostScoreTask.java:139)
    at water.MRTask.compute2(MRTask.java:657)
    at water.MRTask.compute2(MRTask.java:591)
    at water.MRTask.compute2(MRTask.java:591)
    at water.MRTask.compute2(MRTask.java:591)
    at water.MRTask.compute2(MRTask.java:591)
    at water.MRTask.compute2(MRTask.java:591)
    at water.MRTask.compute2(MRTask.java:591)
    at water.H2O$H2OCountedCompleter.compute1(H2O.java:1266)
    at ml.dmlc.xgboost4j.java.XGBoostScoreTask$Icer.compute1(XGBoostScoreTask$Icer.java)
    at water.H2O$H2OCountedCompleter.compute(H2O.java:1262)
    ... 5 more

Error: DistributedException from localhost/127.0.0.1:54321: 'null', caused by java.lang.NullPointerException

我的代码:

my_xgb1 <- h2o.xgboost(x = num_x,
                       y = num_y,
                       training_frame = hex,
                       distribution = "bernoulli",
                       ntrees = 50,
                       max_depth = 3,
                       min_rows = 2,
                       learn_rate = 0.2,
                       nfolds = nfolds,
                       fold_assignment = "Modulo",
                       keep_cross_validation_predictions = TRUE,
                       seed = 1)

注意:相同的代码适用于3.14.0.3

0 个答案:

没有答案