def _check_mdlp_stop(tree, node_id):
"""
The MDLP implementation follows the paper of
U. S. Fayyad and K. B. Irani, Multi-Interval Discretization of Continuous-Valued Attributes for Classification Learning, JPL TRS 1992
http://hdl.handle.net/2014/35171
"""
num_samples = tree.value[node_id].flatten().sum()
gain = _calculate_gain(tree, node_id)
delta = _calculate_noise_delta(tree, node_id)
return gain < (delta + np.log2(num_samples - 1)) / num_samples
评论列表
文章目录