question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poisson criterion in RandomForestRegressor

See original GitHub issue

Describe the workflow you want to enable

I want to officially use the Poisson splitting criterion in RandomForestRegressor.

Describe your proposed solution

#17386 implemented the poisson splitting criterion for DecisionTreeRegressor and ExtraTreeRegressor. This also enabled—somewhat silently—to do:

import numpy as np
from sklearn.ensemble import RandomForestRegressor
y = [0, 1, 2]
X = np.arange(6).reshape(3, 2)
rf = RandomForestRegressor(criterion="poisson")
rf.fit(X, y)

Note: The same is true for ensemble.ExtraTreesRegressor.

Tasks:

  • Add the poisson splitting criterion to the docstring of RandomForestRegressor.
  • Add input validation (non-negative y) to RandomForestRegressor.
  • Expand the tests for RandomForestRegressor.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
pk1130commented, Feb 15, 2021

Hey @lorentzenchr! Apologies for the delay in getting around to this. Opened a pull request like you’d suggested. Done everything other than expanding the test suite. Let me know what you think and whether you’d be able to review. Thanks!

1reaction
lorentzenchrcommented, Feb 1, 2021

@pk1130 Welcome. I hope your motivation keeps on going. You’ll find general advice in the developer’s guide for contributing. The class RandomForestRegressor lives in sklearn/ensemble/_forest.py. Input validation should happen in def fit(..) which is inherited from class BaseForest. So you need to adapt the code there. I would start with adding the poisson criterion to the docstring of RandomForestRegressor. Let me know if you need more guidance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sklearn.ensemble.RandomForestRegressor
New in version 1.0: Poisson criterion. max_depthint, default=None. The maximum depth of the tree. If None, then nodes are expanded until all leaves...
Read more >
Random Forest Regressor - criterion() function. - Kaggle
The function to measure the quality of a split. Supported criteria are “mse” for the mean squared error, which is equal to variance...
Read more >
In Poisson models with an offset, should performance metrics ...
... metrics that can compare a standard Poisson regression (with population offset) to a random forest regressor with Poisson criterion.
Read more >
Regression trees and forests for non-homogeneous Poisson ...
We propose tree and random forest methods for non-homogeneous Poisson processes. The splitting criterion is derived from a model with a piecewise constant ......
Read more >
Regression trees and forests for non ... - ResearchGate
We propose tree and random forest methods for non-homogeneous Poisson processes. The splitting criterion is derived from a model with a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found