Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-6570 Add Friedman and Popescu's H statistics doc (GBM, XGBoost) #15879

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions h2o-docs/src/product/data-science/gbm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,19 @@ Metrics

Usage is illustrated in the Examples section.

GBM Friedman and Popescu's H statistics
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can calculates the Friedman and Popescu's H statistics to test for the presence of an interaction between specified variables.

H varies from 0 to 1. It will have a value of 0 if the model exhibits no interaction between specified variables and a correspondingly larger value for a stronger interaction effect between them. NaN is returned if a computation is spoiled by weak main effects and rounding errors.

This statistic can only be calculated for numerical variables. Missing values are supported.

Reference implementation: `Python <https://pypi.org/project/sklearn-gbmi/>`__ and `R <https://rdrr.io/cran/gbm/man/interact.gbm.html>`__

You can see how it used in the `Examples section <#examples>`__.

Examples
~~~~~~~~

Expand Down Expand Up @@ -394,6 +407,10 @@ Below is a simple example showing how to build a Gradient Boosting Machine model
# Extract feature interactions:
feature_interactions <- h2o.feature_interaction(pros_gbm)

# Get Friedman and Popescu's H statistics
h <- h2o.h(pros_gbm, prostate, c('DPROS','DCAPS'))
print(h)


.. code-tab:: python

Expand Down Expand Up @@ -424,6 +441,10 @@ Below is a simple example showing how to build a Gradient Boosting Machine model
# Extract feature interactions:
feature_interactions = pros_gbm.feature_interaction()

# Get Friedman and Popescu's H statistics
h = pros_gbm.h(prostate_train, ['DPROS','DCAPS'])
print(h)


.. code-tab:: scala

Expand Down Expand Up @@ -481,6 +502,8 @@ York, 2001. <http://statweb.stanford.edu/~tibs/ElemStatLearn/>`__

`Nee, Daniel, "Calibrating Classifier Probabilities", 2014 <http://danielnee.com/tag/platt-scaling>`__

`Jerome H. Friedman and Bogdan E. Popescu, 2008, "Predictive learning via rule ensembles", *Ann. Appl. Stat.* **2**:916-954. <http://projecteuclid.org/download/pdfview_1/euclid.aoas/1223908046>`__

FAQ
~~~

Expand Down
23 changes: 23 additions & 0 deletions h2o-docs/src/product/data-science/xgboost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,19 @@ Metrics

Usage is illustrated in the Examples section.

XGBoost Friedman and Popescu's H statistics
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can calculates the Friedman and Popescu's H statistics to test for the presence of an interaction between specified variables.

H varies from 0 to 1. It will have a value of 0 if the model exhibits no interaction between specified variables and a correspondingly larger value for a stronger interaction effect between them. NaN is returned if a computation is spoiled by weak main effects and rounding errors.

This statistic can only be calculated for numerical variables. Missing values are supported.

Reference implementation: `Python <https://pypi.org/project/sklearn-gbmi/>`__ and `R <https://rdrr.io/cran/gbm/man/interact.gbm.html>`__

You can see how it used in the `Examples section <#examples>`__.

Examples
~~~~~~~~

Expand Down Expand Up @@ -415,6 +428,10 @@ Below is a simple example showing how to build a XGBoost model.
# Extract feature interactions:
feature_interactions = h2o.feature_interaction(titanic_xgb)

# Get Friedman and Popescu's H statistics
h <- h2o.h(titanic_xgb, train, c('fair','age'))
print(h)


.. code-tab:: python

Expand Down Expand Up @@ -451,6 +468,10 @@ Below is a simple example showing how to build a XGBoost model.
# Extract feature interactions:
feature_interactions = titanic_xgb.feature_interaction()

# Get Friedman and Popescu's H statistics
h = titanic_xgb.h(train, ['fair','age'])
print(h)

Note
''''

Expand Down Expand Up @@ -507,4 +528,6 @@ References

- Mitchell R, Frank E. (2017) Accelerating the XGBoost algorithm using GPU computing. PeerJ Preprints 5:e2911v1 `https://doi.org/10.7287/peerj.preprints.2911v1 <https://doi.org/10.7287/peerj.preprints.2911v1>`__

`Jerome H. Friedman and Bogdan E. Popescu, 2008, "Predictive learning via rule ensembles", *Ann. Appl. Stat.* **2**:916-954. <http://projecteuclid.org/download/pdfview_1/euclid.aoas/1223908046>`__