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

Refine config object #1381

Merged
merged 21 commits into from
May 20, 2018
Merged

Refine config object #1381

merged 21 commits into from
May 20, 2018

Conversation

guolinke
Copy link
Collaborator

@guolinke guolinke commented May 19, 2018

Previous config object is complex for developing and documenting.

With this PR, the changes of parameters can be simply written in config.h.
Then we can use helper\parameter_generator.py to generate related codes and documents.

I just finish the code generating part.
@StrikerRUS can you help for the doc part ? Thanks very much !

BTW, also fixed #1364

@StrikerRUS
Copy link
Collaborator

@guolinke
Sure! Just give me some time to understand what's going on here.
And do you mean comments in config.h under "the doc part"?

@StrikerRUS StrikerRUS self-requested a review May 19, 2018 14:11
@guolinke
Copy link
Collaborator Author

guolinke commented May 19, 2018

@StrikerRUS with the python script, the details of these parameters can be captured. Then we can use to generate documents directly.
Besides the 'name', 'type' 'default', 'options', these is field named 'desc' here. while it have 2 indent level: l1 and l2.
you can pint the infos generated by the function in that scripts for more details.

@guolinke
Copy link
Collaborator Author

guolinke commented May 19, 2018

@StrikerRUS do you know why test_skearn will pass sigmoid=-1 , and cause test failed?

updated: fixed, due to the name conflict of saved parameters.

@StrikerRUS
Copy link
Collaborator

@guolinke I tried it locally - cool thing!

Should we add a corresponding step on CIs to generate fresh config_auto.cpp before running tests?

@StrikerRUS
Copy link
Collaborator

StrikerRUS commented May 19, 2018

@guolinke I've gave a brief glance to it and pushed a few things: new nthreads alias (useful in my opinion), new aliases from config.h to Parameters.rst for consistency, fix of duplicated min_gain_to_split alias.

Is metric_types now default name for previous metric (and metric is now an alias)?

Some aliases disappeared from alias table: random_seed
https://github.com/Microsoft/LightGBM/blob/497e60ed144007d051bcdfc8bdb36d4f2f5ff681/include/LightGBM/config.h#L371
and all network params
https://github.com/Microsoft/LightGBM/blob/497e60ed144007d051bcdfc8bdb36d4f2f5ff681/include/LightGBM/config.h#L416-L417
https://github.com/Microsoft/LightGBM/blob/497e60ed144007d051bcdfc8bdb36d4f2f5ff681/include/LightGBM/config.h#L420
https://github.com/Microsoft/LightGBM/blob/497e60ed144007d051bcdfc8bdb36d4f2f5ff681/include/LightGBM/config.h#L450-L451

@StrikerRUS
Copy link
Collaborator

@guolinke I've added with statement into parameter_generator.py and made paths to config files more flexible.

void DCGCalculator::Init(std::vector<double> input_label_gain) {

void DCGCalculator::DefaultEvalAt(std::vector<int>* eval_at) {
if (!eval_at->empty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@guolinke I'm not sure, but it seems to be a typo in condition.

@guolinke
Copy link
Collaborator Author

@StrikerRUS thanks, had fixed them.
BTW, I want to docs can be auto updated by calling that py file, not manually update it (sorry for not stating it clearly).
I think it is very like the current code generate, can you help for that part ?

@StrikerRUS
Copy link
Collaborator

@guolinke yeah, after digging into the code I understand your idea!

Sure, will write a function which will generate a part of Parameters.rst. But I think it should be separate PR. And I'm afraid I have no time today and tomorrow for this :-(.


// alias=num_classes
// desc=need to specify this in multi-class classification
int num_class = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe bring it back to the Objective section?

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

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

@guolinke Could you please give a little bit more detailed description of these parameters. We haven't published them before.

bool enable_load_from_binary_file = true;

// desc=set to false to disable Exclusive Feature Bundling (EFB)
bool enable_bundle = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this one


// check=>=0
// max conflict rate for bundles in EFB
double max_conflict_rate = 0.0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

... and this one


// desc= frequency of saving model file snapshot
// desc= set to positive numbers will enable this function
int snapshot_freq = -1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

... and this one

@guolinke
Copy link
Collaborator Author

@StrikerRUS sure, take your time : )

@guolinke
Copy link
Collaborator Author

@StrikerRUS you can approve this PR if you think it is okay to merge first.

@StrikerRUS
Copy link
Collaborator

Sorry, forgot about it.

@guolinke guolinke merged commit dc69957 into master May 20, 2018
@StrikerRUS StrikerRUS deleted the save-parameter branch May 22, 2018 09:41
@lock lock bot locked as resolved and limited conversation to collaborators Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Python] Can we add the ability to save model parameters to a Booster object?
2 participants