Denoting missing values in expressions
tennenrishin
New Altair Community Member
Hi everyone.
Please bear with me if this has been asked before.
Is there a symbol or identifier that can be used to denote "missing value" in an expression.
For example, I am using the "Generate Attributes" operator, and I want the generated attribute to be missing under some conditions. For example:
if(Denominator==0,missing_value,other_expression)
I have tried "Missing", "MissingValue", "NaN", "Double.NaN' but these don't work, so I end up having to reserve a value and then follow up with the "Declare Missing" operator.
Thanks in advance
Isak
Please bear with me if this has been asked before.
Is there a symbol or identifier that can be used to denote "missing value" in an expression.
For example, I am using the "Generate Attributes" operator, and I want the generated attribute to be missing under some conditions. For example:
if(Denominator==0,missing_value,other_expression)
I have tried "Missing", "MissingValue", "NaN", "Double.NaN' but these don't work, so I end up having to reserve a value and then follow up with the "Declare Missing" operator.
Thanks in advance
Isak
Tagged:
0
Answers
-
Hello Isak,
Use the "Declare Missing Value" operator (under data transformation -> value modification).
regards
Andrew0 -
Thanks Andrew.0
-
Hi,
for numerical attributes you can enter an invalid calculation so for example 0/0.
Greetings,
Sebastian0 -
Thanks Sebastian!0
-
This has been giving me problems too.
In my case I want to use filter examples (on a special attribute) with the attribute value filter. I cant seem to enter "?" in any way to select only examples where att1=?
How can this be done? ???
The way I get around it is change my attribute role to regular then filter missing attributes and then change back the role to special. This only works in my case since I only have one column with missing attributes.
There should be a missing value macro for use in filter expressions! ;D
Thanks,
-Gagi0 -
Hi Gagi,
actually this problem is detailed described in the help window: Missing values for numerical attributes are encoded by ?, for nominal by \?.
Anyway the filter examples operator is on top of our todo list for enhancements. It's quite ugly compared to the attribute selection...
Greetings,
Sebastian0 -
Great thanks Sebastian,
Updating the filter operator would be of great help. Especially for filtering on multiple attribute values, similar to the newer list view in set role.
Thanks,
-Gagi0 -
In my case, to use the solve my problem I had to use double quotes around the macro and the "?".
This seemed to work: if("%{macro}"=="?",1,2)
I guess I just assumed the macro would be treated as a character, but now I understand it just replaces the sring and makes no assumptions about type.
Hope this helps someone. ;D
-GagiSebastian Land wrote:
Hi Gagi,
actually this problem is detailed described in the help window: Missing values for numerical attributes are encoded by ?, for nominal by \?.
Anyway the filter examples operator is on top of our todo list for enhancements. It's quite ugly compared to the attribute selection...
Greetings,
Sebastian0