Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. cdef struct SplitRecord:
  2. # Data to track sample splitting process
  3. # This structure also store the best split found so far
  4. SIZE_t feature # Which feature to split on.
  5. SIZE_t start
  6. SIZE_t end
  7. SIZE_t pos # Split samples array at the given position,
  8. # i.e. count of samples below threshold for feature.
  9. # pos is >= end if the node is a leaf.
  10.  
  11. double impurity
  12. double threshold # Threshold to split at.
  13. double proxy_improvement # Proxy for impurity improvement to speed up
  14. # computation times
  15. double improvement # Impurity improvement given parent node.
  16.  
  17. # Use these to compare the current split stats with the best so far
  18. SIZE_t best_feature
  19. SIZE_t best_pos
  20. double best_threshold
  21. double best_proxy_improvement
  22. # This will be updated only finally to save some computations
  23. double best_improvement
  24.  
  25. # stats for left partition
  26. SIZE_t n_left
  27. double weighted_n_left
  28.  
  29. # stats for right partition
  30. SIZE_t n_right
  31. double weighted_n_right
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement