Changelog¶
0.1.0 (2026-11-29)¶
The first release.
Estimators
causal_forest: an honest causal forest from a formula ("y ~ w | x1 + x2 | fe"), with out-of-bag effects and their variances, the doubly robust average effect with its standard error (clustered when the forest is),best_linear_projectionandcalibration_test(robust or clustered standard errors, in two streaming passes),variable_importanceandpredict. The outcome and treatment are centered with out-of-bag regression forests (nuisance="forest") or a linear fit (nuisance="linear", faster).instrumental_forest: honest forests for the local effects of a treatment that an instrument moves (instrument=), with out-of-bag estimates and their variances, the average of the local effects with its standard error, the best linear projection andpredict. The centering, clustering and weights are the causal forest’s;calibration_testis not available. The average effect keeps the correction’s denominator (the covariance of the treatment and the instrument given the features) at no less than a tenth of its average, so that a few rows where the instrument is weak cannot carry the average, and warns when that applies to one percent of the rows or more.quantile_forest: honest quantile forests, whose trees keep the outcomes of their estimation rows so that any conditional quantile can be predicted; trees are grown to separate the distribution at chosen quantiles. Out-of-bag quantiles,oob_score(pinball loss and coverage),predictfor new rows in batches, and variable importance. Fixed effects, variances andprofile=Trueare not available for it yet.regression_forest: honest regression forests with out-of-bag predictions, variances and variable importance.random_forestfor numeric outcomes and class labels (probabilities andoob_score), with Gini or entropy splits, sampling with replacement (a Poisson bootstrap) or without, and optional honesty.decision_tree, grown level by level from histograms in one pass per level, withtree()listing the nodes.Forests predict without variances unless
variance_group_sizeis above 1.node_size_ruleforrandom_forestanddecision_treeis"split"(grf, ranger and randomForest’s rule: a node of at mostmin_node_sizerows is not split) or"leaf"(scikit-learn’s and rpart’s: every leaf has at least that many rows);regression_forestfollows grf’s rule. Leaves that no estimation-half row reached are pruned, as in grf’s honest trees.
Fixed effects, weights and inference
Fixed effects in
regression_forest,causal_forestandinstrumental_forest(fixed_effects=):"backfit"(default) alternates a forest and the group effects until they change by less thanbackfit_tolerancetimes their standard error (ormax_iterationsrounds, with a warning), re-estimating the leaf values of the first round’s trees in later rounds (backfit_warm_start=True);"outcome_within"subtracts the groups’ outcome means once, with a between-group diagnostic;"group_means"adds the groups’ feature means as features (regression forests).fixef_rmsets whether rows alone in a group take part in the group-effect estimates.weights=in every estimator: sample weights in the splits, the leaves, the effects, the projection and the tests, the nuisance forests, and every regression on the fixed effects.vcov=ofbest_linear_projectionandcalibration_testtakes hdfe-stream’s spellings ("HC0"to"HC3","hetero",{"CRV1": column}); results record hdfe-stream’svcov_typekeys.
Data, memory and prediction
The data are a Parquet path, a glob or a Polars frame. The features are binned (at most 256 bins each) into a file on disk, and trees are grown in batches from passes over it.
max_memory_gbandmemory_reservesize the batches from the memory left; a fit grows at most eight trees per thread at a time;profile=Truereturns the expected memory and disk of a fit, and a fit warns when the budget leaves room for fewer trees per batch than threads, or for no whole group of trees.predictreads and predicts in batches, withoutput=to write a Parquet file,keep=to carry columns through andbatch_rows=;include_fixed_effects=Trueadds each row’s group effects back (withnew_groups=), andgroup_effects()returns them.plot()for every result: effects, heterogeneity, projection, calibration, importance, and the tree.
Tests and benchmarks
Reference tests against rpart, sandwich, grf and ranger (
tests/test_references.py, with the R scriptbenchmarks/external/forest_references.R), and a Monte Carlo comparison with grf and EconML (benchmarks/validation/compare.py).Time, memory and accuracy against grf, ranger, EconML, scikit-learn and quantile-forest from 10,000 to 10 million rows, and the speed-up with threads (
benchmarks/; results in the documentation).