Skip to content

Default QRF grows trees to purity, giving miscalibrated quantiles and inert sample weights #205

Description

@vahid-ahmadi

The default QRF configuration grows trees to purity, so leaves hold a single training point and the "forest" returns essentially the same one or two neighbours for every query. The resulting quantiles are badly miscalibrated.

Coverage on Y | X ~ N(2X, 1), n = 5000:

nominal        0.10   0.25   0.50   0.75   0.90
OLS            0.103  0.256  0.498  0.748  0.905
QuantReg       0.104  0.254  0.505  0.751  0.898
QRF msl=1      0.296  0.376  0.502  0.616  0.697   <- default
QRF msl=50     0.123  0.270  0.500  0.738  0.881

At the default, the nominal 10th percentile covers 30% of the data and the 90th covers 70%. The distribution is far too narrow in the tails, which is exactly where imputed wealth or asset variables matter.

A second consequence: sample weights become inert

With one training point per leaf there is nothing for weights to reweight:

min_samples_leaf=1    unweighted +5.35   weighted +5.35   (identical)
min_samples_leaf=20   unweighted +4.32   weighted -4.58   (follows weights)

The weight plumbing is correct; the default defeats it.

Also: DEFAULT_MODEL_PARAMS is dead code

config.py documents min_samples_leaf: 1, max_depth: None, but DEFAULT_MODEL_PARAMS is never referenced anywhere in the package — the library simply inherits the underlying library's fully-grown defaults. So the documented configuration is not the one in force.

Fix

Wire DEFAULT_MODEL_PARAMS in, and default min_samples_leaf to something in the range 10–20. QRF is the method the benchmarking paper recommends, so its default configuration is worth getting right.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions