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

Missing 'thresholds_and_metric_scores' API for binomial model metrics #15889

Closed
maurever opened this issue Oct 30, 2023 · 0 comments
Closed

Missing 'thresholds_and_metric_scores' API for binomial model metrics #15889

maurever opened this issue Oct 30, 2023 · 0 comments
Assignees
Labels
Milestone

Comments

@maurever
Copy link
Contributor

maurever commented Oct 30, 2023

We cannot call model.thresholds_and_metric_scores() or performance.thresholds_and_metric_scores() with Binomial models and metrics.

>>> from h2o.estimators.gbm import H2OGradientBoostingEstimator
>>> pros = h2o.import_file("https://raw.github.com/h2oai/h2o/master/smalldata/logreg/prostate.csv")
>>> pros["CAPSULE"] = pros["CAPSULE"].asfactor()
>>> train, test = pros.split_frame(ratios = [.75], seed = 1234)
>>> model = H2OGradientBoostingEstimator(distribution = "bernoulli",
...                                      ntrees = 100,
...                                      max_depth = 4,
...                                      learn_rate = 0.1,
...                                      seed = 1234)
>>> model.train(y = "CAPSULE",
...             x = ["AGE", "RACE", "PSA", "GLEASON"],
...             training_frame = train)
>>> model.thresholds_and_metric_scores()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/htillman/miniconda3/lib/python3.8/site-packages/h2o/utils/metaclass.py", line 352, in __getattr__
    return getattr(new_clz, name)
  File "/Users/htillman/miniconda3/lib/python3.8/site-packages/h2o/utils/metaclass.py", line 397, in __getattribute__
    return type.__getattribute__(cls, name)
AttributeError: type object 'ModelBase' has no attribute 'thresholds_and_metric_scores'

Thanks, @hannah-tillman, for discovering this bug.

@maurever maurever added the bug label Oct 30, 2023
@maurever maurever added this to the 3.44.0.2 milestone Oct 30, 2023
@maurever maurever self-assigned this Oct 30, 2023
maurever added a commit that referenced this issue Nov 3, 2023
…5890)

* Fix API

* Fix failed tests

* Fix R param desc

---------

Co-authored-by: Adam Valenta <adam.valenta@h2o.ai>
@maurever maurever closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant