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

More general predict proba. #6817

Merged
merged 7 commits into from Apr 1, 2021
Merged

Conversation

trivialfis
Copy link
Member

  • Use output_margin for softmax.
  • Add test for dask binary cls.
  • Remove unused output margin.

@trivialfis
Copy link
Member Author

trivialfis commented Mar 31, 2021

Marked as blocking for 2 reasons.

  • I found a weird case that the output shape is incorrectly inferred by dask. I'm not sure what's the cause yet. This happens when output prediction is 2-dim (multi-class), which has the same shape as input data and map_blocks seems to be ignoring the change of output shape (from n_features to n_classes). I don't know how exactly is it triggered since before this PR it works fine workes fine on direct load of data where shape is known. Still investigating.
  • multi:softmax can be used safely with classifier, which seems to be a nice thing to have.

# softprob: Do nothing, output is proba.
# softmax: Use output margin to remove the argmax in PredTransform.
# binary:logistic: Expand the prob vector into 2-class matrix after predict.
# binary:logitraw: Unsupported, let's deprecate this objective when possible.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've seen at least a few users using this objective. Should we actually deprecate it?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not clear to me in what scenario is it useful.

Copy link
Member Author

Choose a reason for hiding this comment

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

If you want to have an untransformed prediction, use output_margin instead.

Copy link
Collaborator

@hcho3 hcho3 Apr 1, 2021

Choose a reason for hiding this comment

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

So far we've avoided breaking existing model files, i.e. you could load a very old model file and run predictions. Removing support for binary:logitraw will make old models files inaccessible. We don't yet have a formal policy for changes affecting old model files. (e.g. Wait 3 major versions?)

The objective binary:logitraw is clearly used in the wild already. For example: #6509

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the note.

Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
@trivialfis trivialfis merged commit 47b6248 into dmlc:master Apr 1, 2021
@trivialfis trivialfis deleted the predict-proba branch April 1, 2021 11:52
@trivialfis trivialfis mentioned this pull request Apr 2, 2021
8 tasks
trivialfis added a commit to trivialfis/xgboost that referenced this pull request Apr 6, 2021
* Use `output_margin` for `softmax`.
* Add test for dask binary cls.

Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
trivialfis added a commit that referenced this pull request Apr 6, 2021
* Use `output_margin` for `softmax`.
* Add test for dask binary cls.

Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants