class BinaryMapping
def apply_sign_on_operator(self, operator:OperatorCondition, sign:bool) -> OperatorCondition: Highlight
Invert the operator if there is a sign (a negative literal).
def eliminate_redundant_features(self, reason, contrastive=False): Highlight
A implicant without redundant features i.e. If we have ‘feature_a > 3’ and ‘feature_a > 2’, we keep only the id_binary linked to the boolean
corresponding to the ‘feature_a > 3’ Warning, the ‘implicant’ parameter can be a list of literals or a dict of literals. In the last case, it is a map literal -> weight. Warning: reason can be either a list of literals or a dict literal -> weight
def extract_excluded_features(self, implicant, excluded_features): Highlight
def instance_to_binaries(self, instance, preference_order=None): Highlight
map_id_binaries_to_features: list[id_binary] -> (id_feature, operator, threshold)
map_features_to_id_binaries: dict[(id_feature, operator, threshold)] -> [id_binary, n_appears, n_appears_per_tree] Transform a instance into a cube (conjunction of literals) according to the tree