Classification rule to differentiate 0 and non-zero | Community
Skip to main content
vickyg28253246
Level 3
Oct 2, 2018 9:36 PM UTC
Solved

Classification rule to differentiate 0 and non-zero

I need tt classify the stock position as Y(if value > 0) or N (if value = 0). Since numeric classification is not available, I tried a brute force approach - creating 10 rules with "starts with" (see screenshot).

This has worked for non-zero values, but failed validation if the value is 0.

What are other options?

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Urs_Boller
Urs_BollerAccepted solution
New Participant
Oct 2, 2018 10:17 PM UTC

use a workaround:

- Rule 1: set regex "*" to "N" (everything...)

- Rule 2: set regex "^[1-9]" to "Y"

first, all vaules get "N", but those matching the Rule 2 will get "Y" ...

remark: the classification will take the last match, just use the test interface...

2 replies

vickyg28253246
Level 3
Oct 3, 2018 11:59 AM UTC

Thank you, makes sense.

Translate
Urs_Boller
Urs_BollerAccepted solution
New Participant
Oct 2, 2018 10:17 PM UTC

use a workaround:

- Rule 1: set regex "*" to "N" (everything...)

- Rule 2: set regex "^[1-9]" to "Y"

first, all vaules get "N", but those matching the Rule 2 will get "Y" ...

remark: the classification will take the last match, just use the test interface...

Translate