jpt.learning.pruning

Pruning criteria for JPT learning.

Submodules

Classes

XiPruningCriterion

Prune-or-split callback based on xi.

Package Contents

class jpt.learning.pruning.XiPruningCriterion(alpha: float = 0.05, min_n: int = 30)

Prune-or-split callback based on xi.

Tests whether any feature-target pair shows significant functional dependence in the current partition. Under H0 (independence), sqrt(n) * xi ~ N(0, 2/5).

Parameters:
  • alpha – significance level

  • min_n – minimum samples to apply test

z_crit: float
min_n: int = 30
__call__(jpt: JPT, partition: JPTPartition, indices: numpy.ndarray, data: numpy.ndarray) bool

Return True to prune (stop splitting).

Parameters:
  • jpt – the JPT being learned

  • partition – current data partition

  • indices – index buffer mapping positions to data rows

  • data – the full training data array (n_samples x n_vars)

Returns:

True if the node should become a leaf