adds to_rule_cpd method in TreeCPD class