Denoting missing values in expressions

tennenrishintennenrishin Member Posts: 177 Contributor II
edited November 2018 in Help
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

Answers

  • awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458 Unicorn
    Hello Isak,

    Use the "Declare Missing Value" operator (under data transformation -> value modification).

    regards

    Andrew
  • tennenrishintennenrishin Member Posts: 177 Contributor II
    Thanks Andrew.
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi,
    for numerical attributes you can enter an invalid calculation so for example 0/0.

    Greetings,
      Sebastian
  • tennenrishintennenrishin Member Posts: 177 Contributor II
    Thanks Sebastian!
  • dragoljubdragoljub Member Posts: 241 Contributor II
    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,
    -Gagi
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    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,
      Sebastian
  • dragoljubdragoljub Member Posts: 241 Contributor II
    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,
    -Gagi
  • dragoljubdragoljub Member Posts: 241 Contributor II
    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
    -Gagi
    Sebastian 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,
      Sebastian
Sign In or Register to comment.