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

incorrect logged parameters in model file #2208

Closed
guolinke opened this issue Jun 1, 2019 · 7 comments
Closed

incorrect logged parameters in model file #2208

guolinke opened this issue Jun 1, 2019 · 7 comments

Comments

@guolinke
Copy link
Collaborator

guolinke commented Jun 1, 2019

There is a config2string after training model:

std::string Config::SaveMembersToString() const {
std::stringstream str_buf;
str_buf << "[data: " << data << "]\n";
str_buf << "[valid: " << Common::Join(valid, ",") << "]\n";
str_buf << "[num_iterations: " << num_iterations << "]\n";
str_buf << "[learning_rate: " << learning_rate << "]\n";
str_buf << "[num_leaves: " << num_leaves << "]\n";
str_buf << "[num_threads: " << num_threads << "]\n";
str_buf << "[max_depth: " << max_depth << "]\n";
str_buf << "[min_data_in_leaf: " << min_data_in_leaf << "]\n";
str_buf << "[min_sum_hessian_in_leaf: " << min_sum_hessian_in_leaf << "]\n";
str_buf << "[bagging_fraction: " << bagging_fraction << "]\n";
str_buf << "[bagging_freq: " << bagging_freq << "]\n";
str_buf << "[bagging_seed: " << bagging_seed << "]\n";
str_buf << "[feature_fraction: " << feature_fraction << "]\n";
str_buf << "[feature_fraction_seed: " << feature_fraction_seed << "]\n";
str_buf << "[early_stopping_round: " << early_stopping_round << "]\n";
str_buf << "[first_metric_only: " << first_metric_only << "]\n";
str_buf << "[max_delta_step: " << max_delta_step << "]\n";
str_buf << "[lambda_l1: " << lambda_l1 << "]\n";
str_buf << "[lambda_l2: " << lambda_l2 << "]\n";
str_buf << "[min_gain_to_split: " << min_gain_to_split << "]\n";
str_buf << "[drop_rate: " << drop_rate << "]\n";
str_buf << "[max_drop: " << max_drop << "]\n";
str_buf << "[skip_drop: " << skip_drop << "]\n";
str_buf << "[xgboost_dart_mode: " << xgboost_dart_mode << "]\n";
str_buf << "[uniform_drop: " << uniform_drop << "]\n";
str_buf << "[drop_seed: " << drop_seed << "]\n";
str_buf << "[top_rate: " << top_rate << "]\n";
str_buf << "[other_rate: " << other_rate << "]\n";
str_buf << "[min_data_per_group: " << min_data_per_group << "]\n";
str_buf << "[max_cat_threshold: " << max_cat_threshold << "]\n";
str_buf << "[cat_l2: " << cat_l2 << "]\n";
str_buf << "[cat_smooth: " << cat_smooth << "]\n";
str_buf << "[max_cat_to_onehot: " << max_cat_to_onehot << "]\n";
str_buf << "[top_k: " << top_k << "]\n";
str_buf << "[monotone_constraints: " << Common::Join(Common::ArrayCast<int8_t, int>(monotone_constraints), ",") << "]\n";
str_buf << "[feature_contri: " << Common::Join(feature_contri, ",") << "]\n";
str_buf << "[forcedsplits_filename: " << forcedsplits_filename << "]\n";
str_buf << "[refit_decay_rate: " << refit_decay_rate << "]\n";
str_buf << "[cegb_tradeoff: " << cegb_tradeoff << "]\n";
str_buf << "[cegb_penalty_split: " << cegb_penalty_split << "]\n";
str_buf << "[cegb_penalty_feature_lazy: " << Common::Join(cegb_penalty_feature_lazy, ",") << "]\n";
str_buf << "[cegb_penalty_feature_coupled: " << Common::Join(cegb_penalty_feature_coupled, ",") << "]\n";
str_buf << "[verbosity: " << verbosity << "]\n";
str_buf << "[max_bin: " << max_bin << "]\n";
str_buf << "[min_data_in_bin: " << min_data_in_bin << "]\n";
str_buf << "[bin_construct_sample_cnt: " << bin_construct_sample_cnt << "]\n";
str_buf << "[histogram_pool_size: " << histogram_pool_size << "]\n";
str_buf << "[data_random_seed: " << data_random_seed << "]\n";
str_buf << "[output_model: " << output_model << "]\n";
str_buf << "[snapshot_freq: " << snapshot_freq << "]\n";
str_buf << "[input_model: " << input_model << "]\n";
str_buf << "[output_result: " << output_result << "]\n";
str_buf << "[initscore_filename: " << initscore_filename << "]\n";
str_buf << "[valid_data_initscores: " << Common::Join(valid_data_initscores, ",") << "]\n";
str_buf << "[pre_partition: " << pre_partition << "]\n";
str_buf << "[enable_bundle: " << enable_bundle << "]\n";
str_buf << "[max_conflict_rate: " << max_conflict_rate << "]\n";
str_buf << "[is_enable_sparse: " << is_enable_sparse << "]\n";
str_buf << "[sparse_threshold: " << sparse_threshold << "]\n";
str_buf << "[use_missing: " << use_missing << "]\n";
str_buf << "[zero_as_missing: " << zero_as_missing << "]\n";
str_buf << "[two_round: " << two_round << "]\n";
str_buf << "[save_binary: " << save_binary << "]\n";
str_buf << "[header: " << header << "]\n";
str_buf << "[label_column: " << label_column << "]\n";
str_buf << "[weight_column: " << weight_column << "]\n";
str_buf << "[group_column: " << group_column << "]\n";
str_buf << "[ignore_column: " << ignore_column << "]\n";
str_buf << "[categorical_feature: " << categorical_feature << "]\n";
str_buf << "[predict_raw_score: " << predict_raw_score << "]\n";
str_buf << "[predict_leaf_index: " << predict_leaf_index << "]\n";
str_buf << "[predict_contrib: " << predict_contrib << "]\n";
str_buf << "[num_iteration_predict: " << num_iteration_predict << "]\n";
str_buf << "[pred_early_stop: " << pred_early_stop << "]\n";
str_buf << "[pred_early_stop_freq: " << pred_early_stop_freq << "]\n";
str_buf << "[pred_early_stop_margin: " << pred_early_stop_margin << "]\n";
str_buf << "[convert_model_language: " << convert_model_language << "]\n";
str_buf << "[convert_model: " << convert_model << "]\n";
str_buf << "[num_class: " << num_class << "]\n";
str_buf << "[is_unbalance: " << is_unbalance << "]\n";
str_buf << "[scale_pos_weight: " << scale_pos_weight << "]\n";
str_buf << "[sigmoid: " << sigmoid << "]\n";
str_buf << "[boost_from_average: " << boost_from_average << "]\n";
str_buf << "[reg_sqrt: " << reg_sqrt << "]\n";
str_buf << "[alpha: " << alpha << "]\n";
str_buf << "[fair_c: " << fair_c << "]\n";
str_buf << "[poisson_max_delta_step: " << poisson_max_delta_step << "]\n";
str_buf << "[tweedie_variance_power: " << tweedie_variance_power << "]\n";
str_buf << "[max_position: " << max_position << "]\n";
str_buf << "[label_gain: " << Common::Join(label_gain, ",") << "]\n";
str_buf << "[metric_freq: " << metric_freq << "]\n";
str_buf << "[is_provide_training_metric: " << is_provide_training_metric << "]\n";
str_buf << "[eval_at: " << Common::Join(eval_at, ",") << "]\n";
str_buf << "[multi_error_top_k: " << multi_error_top_k << "]\n";
str_buf << "[num_machines: " << num_machines << "]\n";
str_buf << "[local_listen_port: " << local_listen_port << "]\n";
str_buf << "[time_out: " << time_out << "]\n";
str_buf << "[machine_list_filename: " << machine_list_filename << "]\n";
str_buf << "[machines: " << machines << "]\n";
str_buf << "[gpu_platform_id: " << gpu_platform_id << "]\n";
str_buf << "[gpu_device_id: " << gpu_device_id << "]\n";
str_buf << "[gpu_use_dp: " << gpu_use_dp << "]\n";
return str_buf.str();
}

However, as some parameters are not visible in cpp side when using python/R package, such as num_iteration in python package. Therefore, some logged parameters are not correct.

@guolinke guolinke added the bug label Jun 1, 2019
@guolinke
Copy link
Collaborator Author

guolinke commented Jun 1, 2019

to fix this, I think we should pass all parameters to cpp code, even though some of them are not used in cpp side.

@Xiad32
Copy link

Xiad32 commented Oct 8, 2019

So, what other configurations are needed here beside num_iteration? Would they differ based on the class where they are used; RF,GOSS or DART?

@guolinke
Copy link
Collaborator Author

@Xiad32 these configurations just log the error values in the model file, it doesn't affect the normal usage.

@StrikerRUS
Copy link
Collaborator

Python-package has been fixed in #2589.

ping @jameslamb and @Laurae2 for R-package.

@jameslamb
Copy link
Collaborator

@StrikerRUS hey thanks for the ping, this one was not on my radar. I'll pick it up

@jameslamb jameslamb self-assigned this Mar 6, 2020
@StrikerRUS
Copy link
Collaborator

@jameslamb Great! Thank you.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants