Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predict on Aggregator model throws NPE #8066

Closed
exalate-issue-sync bot opened this issue May 11, 2023 · 3 comments
Closed

Predict on Aggregator model throws NPE #8066

exalate-issue-sync bot opened this issue May 11, 2023 · 3 comments

Comments

@exalate-issue-sync
Copy link

When scoring (predict()) with Aggregator model H2O throws NPE:

{code:python}
from h2o.estimators.aggregator import H2OAggregatorEstimator
import h2o

h2o.init()

winequality_df = h2o.import_file("https://h2o-public-test-data.s3.amazonaws.com/smalldata/wine/winequality-redwhite.csv")

params = {
"target_num_exemplars": 650,
"rel_tol_num_exemplars": 0.25,
"save_mapping_frame": True
}
agg = H2OAggregatorEstimator(ignored_columns = ['quality', 'type'], **params)
agg.train(training_frame=winequality_df)
agg_preds = agg.predict(winequality_df)
{code}

{noformat}
aggregator prediction progress: | (failed)


OSError Traceback (most recent call last)
in
----> 1 agg_preds = agg.predict(winequality_df)

~/opt/anaconda3/lib/python3.7/site-packages/h2o/model/model_base.py in predict(self, test_data, custom_metric, custom_metric_func)
233 j = H2OJob(h2o.api("POST /4/Predictions/models/%s/frames/%s" % (self.model_id, test_data.frame_id), data = {'custom_metric_func': custom_metric_func}),
234 self._model_json["algo"] + " prediction")
--> 235 j.poll()
236 return h2o.get_frame(j.dest_key)
237

~/opt/anaconda3/lib/python3.7/site-packages/h2o/job.py in poll(self, poll_updates)
76 if (isinstance(self.job, dict)) and ("stacktrace" in list(self.job)):
77 raise EnvironmentError("Job with key {} failed with an exception: {}\nstacktrace: "
---> 78 "\n{}".format(self.job_key, self.exception, self.job["stacktrace"]))
79 else:
80 raise EnvironmentError("Job with key %s failed with an exception: %s" % (self.job_key, self.exception))

OSError: Job with key $03017f00000132d4ffffffff$_8224adaa6615a6a2147dfebd7a87462a failed with an exception: java.lang.NullPointerException
stacktrace:
java.lang.NullPointerException
at hex.Model.score(Model.java:1516)
at water.api.ModelMetricsHandler$1.compute2(ModelMetricsHandler.java:396)
at water.H2O$H2OCountedCompleter.compute(H2O.java:1557)
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)

{noformat}

@exalate-issue-sync
Copy link
Author

Gregory Kanevsky commented: also, might not be related, but it appears that setting {{"save_mapping_frame": True}} has no effect.

@exalate-issue-sync
Copy link
Author

Michal Kurka commented: Predict is not supported with the aggregator model, I added support for retrieving the Mappings Frame.

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Migration Info

Jira Issue: PUBDEV-7572
Assignee: Michal Kurka
Reporter: Gregory Kanevsky
State: Resolved
Fix Version: 3.30.0.4
Attachments: N/A
Development PRs: Available

Linked PRs from JIRA

#4652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant