Comments (4)
I am not sure I understand. Feel free to submit a PR with the change to be able to directly see the diff.
from pygbm.
I'm proposing what I have done in scikit-learn/scikit-learn#12807
grower._compute_spittability()
will look like this:
if node.hist_subtraction:
if node is node.parent.right_child:
sum_gradients = node.parent.split_info.gradient_right
sum_hessians = node.parent.split_info.hessian_right
else:
sum_gradients = node.parent.split_info.gradient_left
sum_hessians = node.parent.split_info.hessian_left
split_info = self.splitter.find_node_split_subtraction(
node.sample_indices,
sum_gradients, sum_hessians, node.parent.histograms,
node.sibling.histograms, histograms)
else:
split_info = self.splitter.find_node_split(
node.sample_indices, histograms)
and we can remove these lines in the find_node_split_subtraction
:
# We can pick any feature (here the first) in the histograms to
# compute the gradients: they must be the same across all features
# anyway, we have tests ensuring this. Maybe a more robust way would
# be to compute an average but it's probably not worth it.
context.sum_gradients = (parent_histograms[0]['sum_gradients'].sum() -
sibling_histograms[0]['sum_gradients'].sum())
n_samples = sample_indices.shape[0]
if context.constant_hessian:
context.sum_hessians = \
context.constant_hessian_value * float32(n_samples)
else:
context.sum_hessians = (parent_histograms[0]['sum_hessians'].sum() -
sibling_histograms[0]['sum_hessians'].sum())
from pygbm.
Ok +1.
from pygbm.
Actually as we just discussed, we don't need to recompute sum_gradients and sum_hessians regardless of the histogram computation method that is used.
from pygbm.
Related Issues (20)
- API documentation is broken HOT 1
- All the examples require lightgbm HOT 1
- Allow score monitoring regardless of early stopping
- Optimize score loss computation
- Remove empty slice check (numba fixed the issue)
- Reuse grower (and thus the splitter) instead of creating a new one
- Updating to Scipy 1.2.0 breaks loss tests... HOT 2
- Optionally use left/right indices buffer HOT 7
- Avoid ordered_gradients? HOT 7
- Remove constant_hessian_value? HOT 1
- Optimize categorical crossentropy gradient update HOT 3
- _update_raw_predictions() throws a deprecation warning HOT 1
- numba-integration-test failure HOT 6
- Status of this project? HOT 2
- Implement native support for missing values
- did you stopped development since since can not do better than lightGBM pr Xgboost pr catboost? HOT 4
- Implement histogram recycling to improve memory efficiency
- Recent Numba not usable with pygbm HOT 1
- Parallel splitting fails in nopython mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygbm.