jpt.learning.pruning.xi ======================= .. py:module:: jpt.learning.pruning.xi .. autoapi-nested-parse:: Xi-correlation-based pruning criterion. Uses Chatterjee's xi coefficient to decide whether a split is justified by statistically significant functional dependence between features and targets in the current partition. Classes ------- .. autoapisummary:: jpt.learning.pruning.xi.XiPruningCriterion Module Contents --------------- .. py:class:: 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). :param alpha: significance level :param min_n: minimum samples to apply test .. py:attribute:: z_crit :type: float .. py:attribute:: min_n :type: int :value: 30 .. py:method:: __call__(jpt: JPT, partition: JPTPartition, indices: numpy.ndarray, data: numpy.ndarray) -> bool Return True to prune (stop splitting). :param jpt: the JPT being learned :param partition: current data partition :param indices: index buffer mapping positions to data rows :param data: the full training data array (n_samples x n_vars) :returns: True if the node should become a leaf