Skip to content

crflynn/skgrf

Repository files navigation

skgrf

build wheels rtd pypi pyversions

skgrf provides scikit-learn compatible Python bindings to the C++ random forest implementation, grf, using Cython.

The latest release of skgrf uses version 2.1.0 of grf.

skgrf is still in development. Please create issues for any discrepancies or errors. PRs welcome.

Documentation

Installation

skgrf is available on pypi and can be installed via pip:

Estimators

  • GRFForestCausalRegressor
  • GRFForestInstrumentalRegressor
  • GRFForestLocalLinearRegressor
  • GRFForestQuantileRegressor
  • GRFForestRegressor
  • GRFBoostedForestRegressor
  • GRFForestSurvival

Usage

GRFForestRegressor

The GRFForestRegressor predictor uses grf's RegressionPredictionStrategy class.

GRFForestQuantileRegressor

The GRFForestQuantileRegressor predictor uses grf's QuantilePredictionStrategy class.

License

skgrf is licensed under GPLv3.

Development

To develop locally, it is recommended to have asdf, make and a C++ compiler already installed. After cloning, run make setup. This will setup the grf submodule, install python and poetry from .tool-versions, install dependencies using poetry, copy the grf source code into skgrf, and then build and install skgrf in the local virtualenv.

To format code, run make fmt. This will run isort and black against the .py files.

To run tests and inspect coverage, run make test or make xtest for testing in parallel.

To rebuild in place after making changes, run make build.

To create python package artifacts, run make dist.

To build and view documentation, run make docs.