-
Notifications
You must be signed in to change notification settings - Fork 1.9k
refactor: Refactor cats_tree.cc to use builder to set features of learner #3053
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
Changes from 3 commits
4e8d79b
dad9ba5
d36443e
b7bf12a
f137889
3bf8b0b
5b4f0f1
9e62635
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,7 @@ struct node_cost | |
| { | ||
| uint32_t node_id; | ||
| float cost; | ||
| node_cost(uint32_t node_id = 0, float cost = 0) : node_id(node_id), cost(cost) {} | ||
|
||
| }; | ||
|
|
||
| struct cats_tree | ||
|
|
@@ -72,7 +73,7 @@ struct cats_tree | |
| uint64_t app_seed = uniform_hash("vw", 2, 0); | ||
| std::string tree_stats_to_string(); | ||
| min_depth_binary_tree _binary_tree; | ||
| float _cost_star; | ||
| float _cost_star = 0; | ||
|
||
| node_cost _a; | ||
| node_cost _b; | ||
| std::ostream* _trace_stream = nullptr; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like
_cost_star, _a, _bare unitialized after this call.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just recommitted. Let me know if manually initializing _a and _b is preferred to creating a constructor in node_cost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the node_cost initialization done internally is good as it affects any other usage too. So this approach is better