Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CompoundPredicates #7

Open
iamDecode opened this issue Feb 11, 2019 · 0 comments
Open

Support CompoundPredicates #7

iamDecode opened this issue Feb 11, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@iamDecode
Copy link
Owner

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
@iamDecode iamDecode added the enhancement New feature or request label Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant