Skip to content

v0.2.0: Scikit-learn Compatible API

Latest

Choose a tag to compare

@haytug haytug released this 20 Jan 11:22
d9df789

What's New

This release adds scikit-learn compatible methods to CFFEForest, making it easier to inspect, configure, and integrate with standard ML workflows.

New Methods

  • __repr__() / __str__() - Informative string representation instead of <object at 0x...>
  • get_params() / set_params() - Get and set estimator parameters
  • score() - R² score for CATE predictions (useful for simulations with known true effects)
  • clone() - Create an unfitted copy with the same parameters

Example

>>> forest = CFFEForest(n_trees=100, max_depth=4)
>>> print(forest)
CFFEForest(n_trees=100, max_depth=4, min_leaf=20)
  Fitted: No

>>> forest.get_params()
{'n_trees': 100, 'max_depth': 4, 'min_leaf': 20, 'honest': True, ...}

>>> forest.set_params(n_trees=200)