* Data structure that contains the info for lower sub-trees */
| 482 | * Data structure that contains the info for lower sub-trees |
| 483 | */ |
| 484 | struct SubTreeInfo { |
| 485 | /* id of the root node of the subtree */ |
| 486 | int root_id; |
| 487 | |
| 488 | /* number of node splits */ |
| 489 | int n_split; |
| 490 | /* current node's own risk */ |
| 491 | double risk; |
| 492 | /* |
| 493 | * accumulated risk of sub-tree with the current |
| 494 | * node being the root |
| 495 | */ |
| 496 | double sum_risk; |
| 497 | /* sub-tree's average risk improvement per split */ |
| 498 | double complexity; |
| 499 | |
| 500 | SubTreeInfo * left_child; |
| 501 | SubTreeInfo * right_child; |
| 502 | |
| 503 | SubTreeInfo(int i, int n, double r, double s, double c): |
| 504 | root_id(i), n_split(n), risk(r), sum_risk(s), complexity(c){ |
| 505 | left_child = NULL; |
| 506 | right_child = NULL; |
| 507 | } |
| 508 | }; |
| 509 | |
| 510 | |
| 511 | // FIXME: Remove after finalzing code |