Skip to content

Commit

Permalink
RF: Add Poisson deviance impurity criterion (rapidsai#4156)
Browse files Browse the repository at this point in the history
* Adds the poisson impurity criterion to RF, in parity with scikit learn's RF regressor [[here](https://scikit-learn.org/stable/modules/tree.html#regression-criteria)]
EDIT:
* Also adds C++ level testing for RF Objective function gains of Poisson and Gini.

Authors:
  - Venkat (https://github.com/venkywonka)

Approvers:
  - Rory Mitchell (https://github.com/RAMitchell)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: rapidsai#4156
  • Loading branch information
venkywonka authored Sep 22, 2021
1 parent 094d7d2 commit 50af90b
Show file tree
Hide file tree
Showing 12 changed files with 514 additions and 151 deletions.
1 change: 1 addition & 0 deletions cpp/include/cuml/tree/algo_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum CRITERION {
ENTROPY,
MSE,
MAE,
POISSON,
CRITERION_END,
};

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/decisiontree/batched-levelalgo/builder.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ struct Builder {
int nHistBins = large_blocks * nbins * colBlks * nclasses;
CUDA_CHECK(cudaMemsetAsync(hist, 0, sizeof(BinT) * nHistBins, handle.get_stream()));
ML::PUSH_RANGE("computeSplitClassificationKernel @builder_base.cuh [batched-levelalgo]");
ObjectiveT objective(input.numOutputs, params.min_impurity_decrease, params.min_samples_leaf);
ObjectiveT objective(input.numOutputs, params.min_samples_leaf);
computeSplitKernel<DataT, LabelT, IdxT, TPB_DEFAULT>
<<<grid, TPB_DEFAULT, smemSize, handle.get_stream()>>>(hist,
params.n_bins,
Expand Down Expand Up @@ -456,7 +456,7 @@ struct Builder {
rmm::device_uvector<InstanceRange> d_instance_ranges(max_batch_size, handle.get_stream());
rmm::device_uvector<DataT> d_leaves(max_batch_size * input.numOutputs, handle.get_stream());

ObjectiveT objective(input.numOutputs, params.min_impurity_decrease, params.min_samples_leaf);
ObjectiveT objective(input.numOutputs, params.min_samples_leaf);
for (std::size_t batch_begin = 0; batch_begin < tree->sparsetree.size();
batch_begin += max_batch_size) {
std::size_t batch_end = min(batch_begin + max_batch_size, tree->sparsetree.size());
Expand Down
Loading

0 comments on commit 50af90b

Please sign in to comment.