java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • There is an error when you train a StackedEnsemble on a training frame which has a response column that was converted to a factor after parsing the dataset. I'm guessing this has something to do with creating a temporary frame that contains the newly encoded factor response column. * one that converts the 0/1 response to factor for binary classification, and this produces the error. * one that does not convert the response (and hence performs regression) and this does not produce the error. Error below: {code} In [7]: stack = H2OStackedEnsembleEstimator(selection_strategy="choose_all", base_models=grid.model_ids) In [9]: stack.train(y=y, training_frame=train) stackedensemble Model Build progress: | (failed) | 0% --------------------------------------------------------------------------- EnvironmentError Traceback (most recent call last) <ipython-input-9-25075e2dda48> in <module>() ----> 1 stack.train(y=y, training_frame=train) #argh... an error / stacktrace here /Users/me/h2oai/code/ensemble/ensembles-branch/h2o-py/h2o/estimators/estimator_base.pyc in train(self, x, y, training_frame, offset_column, fold_column, weights_column, validation_frame, max_runtime_secs, ignored_columns) 227 return 228 --> 229 model.poll() 230 model_json = h2o.api("GET /%d/Models/%s" % (rest_ver, model.dest_key))["models"][0] 231 self._resolve_model(model.dest_key, model_json) /Users/me/h2oai/code/ensemble/ensembles-branch/h2o-py/h2o/job.pyc in poll(self) 74 if (isinstance(self.job, dict)) and ("stacktrace" in list(self.job)): 75 raise EnvironmentError("Job with key {} failed with an exception: {}\nstacktrace: " ---> 76 "\n{}".format(self.job_key, self.exception, self.job["stacktrace"])) 77 else: 78 raise EnvironmentError("Job with key %s failed with an exception: %s" % (self.job_key, self.exception)) EnvironmentError: Job with key $03017f00000132d4ffffffff$_a88b2815cb00529678aa6539f5f04a19 failed with an exception: java.lang.NullPointerException stacktrace: java.lang.NullPointerException at water.fvec.Frame.<init>(Frame.java:111) at water.fvec.Frame.<init>(Frame.java:83) at water.fvec.Frame.<init>(Frame.java:78) at water.fvec.Frame.add(Frame.java:549) at hex.ensemble.StackedEnsemble$StackedEnsembleDriver.prepareLevelOneFrame(StackedEnsemble.java:65) at hex.ensemble.StackedEnsemble$StackedEnsembleDriver.computeImpl(StackedEnsemble.java:94) at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:169) at water.H2O$H2OCountedCompleter.compute(H2O.java:1217) 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) {code}
    via by Erin LeDell,
  • H2O Build git branch ensembles H2O Build git hash db0897813657e6ec8ff3d6af09d0a901da8125b6 {code:java} library(h2o) h= h2o.init() train <- h2o.importFile("/Users/nidhimehta/Desktop/data/datasets/adult_data.csv",destination_frame = "train") test <- h2o.importFile("/Users/nidhimehta/Desktop/data/datasets/adult_test.csv",destination_frame = "test") y = "income" #y <- "response" x <- setdiff(names(train), y) family <- "binomial" #For binary classification, response should be a factor train[,y] <- as.factor(train[,y]) test[,y] <- as.factor(test[,y]) nfolds <- 5 glm1 <- h2o.glm(x = x, y = y, family = family ,model_id = "glm1",seed = 1, training_frame = train, nfolds = nfolds, fold_assignment = "Modulo", keep_cross_validation_predictions = TRUE) #0.9051657 gbm1 <- h2o.gbm(x = x, y = y, model_id = "gbm1",distribution = "AUTO", training_frame = train, seed = 1, nfolds = nfolds, fold_assignment = "Modulo", keep_cross_validation_predictions = TRUE) #0.9238456 rf1 <- h2o.randomForest(x = x, y = y,model_id = "rf1",# distribution not used for RF training_frame = train, seed = 1, nfolds = nfolds, fold_assignment = "Modulo", keep_cross_validation_predictions = TRUE) #0.9141257 dl1 <- h2o.deeplearning(x = x, y = y,model_id = "dl1",distribution = "AUTO",reproducible = T,seed = 1, training_frame = train, nfolds = nfolds, fold_assignment = "Modulo", keep_cross_validation_predictions = TRUE) #0.9122962 ss1 = h2o.stackedEnsemble(x, y, train, model_id="modelc", selection_strategy = c("choose_all"), base_models = list(glm1@model_id,gbm1@model_id,rf1@model_id,dl1@model_id)) {code} {code:java} | | 0% java.lang.NullPointerException java.lang.NullPointerException at water.fvec.Frame.<init>(Frame.java:111) at water.fvec.Frame.<init>(Frame.java:83) at water.fvec.Frame.<init>(Frame.java:78) at water.fvec.Frame.add(Frame.java:549) at hex.ensemble.StackedEnsemble.addModelPredictionsToLevelOneFrame(StackedEnsemble.java:53) at hex.ensemble.StackedEnsemble$StackedEnsembleDriver.prepareLevelOneFrame(StackedEnsemble.java:83) at hex.ensemble.StackedEnsemble$StackedEnsembleDriver.computeImpl(StackedEnsemble.java:105) at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:169) at water.H2O$H2OCountedCompleter.compute(H2O.java:1217) 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) Error: java.lang.NullPointerException {code}
    via by Nidhi Mehta,
    • java.lang.NullPointerException at water.fvec.Frame.<init>(Frame.java:101) at water.fvec.Frame.<init>(Frame.java:72) at water.rapids.ASTRepLen.apply(ASTOp.java:2874) at water.rapids.AST.treeWalk(AST.java:49) at water.rapids.AST.treeWalk(AST.java:83) at water.rapids.Exec.exec(Exec.java:68) at water.api.RapidsHandler.exec(RapidsHandler.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at water.api.Handler.handle(Handler.java:56) at water.api.RequestServer.handle(RequestServer.java:677) at water.api.RequestServer.serve(RequestServer.java:614) at water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438) at java.lang.Thread.run(Thread.java:745)
    No Bugmate found.