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

Update eval_metric validation to support list of strings #8826

Merged

Conversation

mzzhang95
Copy link
Contributor

Hey guys, I find that SparkXGB estimators do not support multiple evaluation metric because of param validation.

In this PR, I deleted the param validation for eval_metrics.

@hcho3
Copy link
Collaborator

hcho3 commented Feb 21, 2023

Did you test this pull request on your machine?

@mzzhang95
Copy link
Contributor Author

Did you test this pull request on your machine?

Yes, I have tested it. It works well. After deleting these three lines, I am able to train a SparkXGB model with multiple eval_metrics.

@wbo4958
Copy link
Contributor

wbo4958 commented Feb 22, 2023

@mzzhang95 Seems eval_metric can accept str or list[str], could you add the list[str] support instead of getting rid of the validation?

Validate if eval_metric is a string or a list of strings.
@mzzhang95
Copy link
Contributor Author

@mzzhang95 Seems eval_metric can accept str or list[str], could you add the list[str] support instead of getting rid of the validation?

I added the check back. Now it will check both str and List[str] for eval_metric.

@mzzhang95 mzzhang95 changed the title Bypass eval_metric validation Update eval_metric validation to support list of strings Feb 22, 2023
Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

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

Thank you for the fix! Could you please help add a simple test in

?

We use pytest for running python tests.

@mzzhang95
Copy link
Contributor Author

I added two unit tests for string type and list type eval_metric with ``SparkXGBoostClassifier`. Do you also wanna include regressor and ranker?

And when could this PR be merged? Will there be a release in recent? Thank!

@trivialfis
Copy link
Member

And when could this PR be merged?

I should be able to merge it once all tests pass.

Will there be a release in recent? Thank!

Patch release for critical bug fixes only. The next major release will take some time.

@trivialfis trivialfis merged commit 6cef9a0 into dmlc:master Mar 2, 2023
This pull request was closed.
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.

4 participants