Skip to content

Support CompoundPredicates #7

@iamDecode

Description

@iamDecode

rpart in R uses CompoundPredicates by default, we should support it. This can be implemented by chaining a few nodes back to back. Examples:

booleanType: and

[A < 1 and B > 2]                     [A < 1]
        └─N⟶ 2        becomes           └─N⟶ 1
        └─Y⟶ 5                          └─Y⟶ [B > 2]
                                                   └─N⟶ 1
                                                   └─Y⟶ 5

(and it seems booleanType surrogate is also treated as and, except nan-checks, which we do not yet support)

booleanType: or

[A < 1 or B > 2]                     [A < 1]
       └─Y⟶ 5        becomes           └─Y⟶ 4
       └─N⟶ 2                          └─N⟶ [B > 2]
                                                   └─Y⟶ 1
                                                   └─N⟶ 2

booleanType: xor

[A < 1 xor B > 2]                     [A < 1]
        └─Y⟶ 5        becomes           └─Y⟶ [B > 2]
        └─N⟶ 2                                   └─Y⟶ 1
                                                   └─N⟶ 3
                                          └─N⟶ [B > 2]
                                                   └─Y⟶ 2
                                                   └─N⟶ 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions