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

Tabular: Raise regression pred_proba #3240

Merged
merged 3 commits into from
May 26, 2023

Conversation

Innixma
Copy link
Contributor

@Innixma Innixma commented May 25, 2023

Issue #, if available:

Resolves #2685

Description of changes:

Update TabularPredictor to raise an AssertionError when predict_proba and predict_proba_multi are called when the problem type is regression or quantile. This aligns the logic with MultimodalPredictor.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link

Job PR-3240-5413439 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-3240/5413439/index.html

Copy link
Contributor

@gradientsky gradientsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor nit comments

Comment on lines 9 to 13
"""Simple class that holds information on what a problem type is capable of doing"""
def __init__(self,
can_predict: bool,
can_predict_proba: bool,
is_classification: bool):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: params docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -1338,7 +1346,7 @@ def fit_pseudolabel(self, pseudo_data: pd.DataFrame, max_iter: int = 5, return_p
self.fit_weighted_ensemble()

if return_pred_prob:
y_pred_proba = self.predict_proba(pseudo_data)
y_pred_proba = self.predict_proba(pseudo_data) if self.can_predict_proba else self.predict(pseudo_data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: split into if-else to have consistency vs other places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will keep for now, it will be unified once we apply black in future

@Innixma Innixma merged commit 45622c6 into autogluon:master May 26, 2023
3 checks passed
@github-actions
Copy link

Job PR-3240-204271c is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-3240/204271c/index.html

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

Successfully merging this pull request may close these issues.

[v0.8] Tabular: Throw Exception when calling predict_proba in regression
2 participants