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

Include init_score on the Python Booster class #4065

Closed
JoshuaC3 opened this issue Mar 12, 2021 · 2 comments
Closed

Include init_score on the Python Booster class #4065

JoshuaC3 opened this issue Mar 12, 2021 · 2 comments

Comments

@JoshuaC3
Copy link

JoshuaC3 commented Mar 12, 2021

Summary

Add init_score_values as a parameter on the Python Booster class. Currently, it is only available on the Dataset class.

Motivation

Currently, it is a little tricky to find init_score after a model is trained. While it can be set, and therefore known, when boost_from_average it isn't. When saving a model, the easy access to this presumably gets lost. Therefore, it would be useful to have it as an attribute on the model.

It then allows us to access it via the sklearn API.

Description

See here for further details and initial motivation.

@JoshuaC3
Copy link
Author

JoshuaC3 commented Mar 12, 2021

Possibly something like,

    for dataset_name, eval_name, score, _ in evaluation_result_list:
        booster.best_score[dataset_name][eval_name] = score

    booster.init_score_value = trainset.get_init_score()

    if not keep_training_booster:
        booster.model_from_string(booster.model_to_string(), False).free_dataset()

here.

@StrikerRUS
Copy link
Collaborator

Closed in favor of being in #2302. We decided to keep all feature requests in one place.

Welcome to contribute this feature! Please re-open this issue (or post a comment if you are not a topic starter) if you are actively working on implementing this feature.

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

2 participants