The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

"Regular expression problem..."

AxelAxel Member Posts: 19 Maven
edited May 2019 in Help
Hi everbody,

I try to use the Mapping operator to replace some attribute values by others.
Possible values are:  "disease1", "disiease2", "disease3" and  "Healthy".
I want to replace everything that is NOT "Healthy" by  "Sick" and try a regex with negative lookahead like this: ^(?!Healthy).

Unfortunately, nothing is replaced :-(
What am I doing wrong ?  When I test the regex at http://www.regexplanet.com/simple/index.html it seems to work.

Thanks,

Axel
Tagged:

Answers

  • haddockhaddock Member Posts: 849 Maven
    Hi there Axel,

    I think you needed a bit more, like this...
    <operator name="Root" class="Process" expanded="yes">
        <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
            <parameter key="target_function" value="random"/>
        </operator>
        <operator name="BinDiscretization" class="BinDiscretization">
            <parameter key="range_name_type" value="short"/>
        </operator>
        <operator name="Replace" class="Replace">
            <parameter key="attributes" value="a.*"/>
            <parameter key="replace_what" value="\b(?:(?!range1)\w)+\b"/>
            <parameter key="replace_by" value="Haddock"/>
        </operator>
    </operator>
    Regex can turn normal humans to wobbly puddings, so I use RegexBuddy, and commend it to all but the most pointy-headed ascetics.


    Pip Pip

    ( Exit Uncle Beastly stage left...)



  • steffensteffen Member Posts: 347 Maven
    This is madness  :o

    If the possible values are restricted to those mentioned by axel, then use this one:

    disease.*
    regards,

    steffen
  • haddockhaddock Member Posts: 849 Maven
    Steffen, really!!  :'(
    If the possible values are restricted to those mentioned by axel, then use this one:
    True enough. But that is not what
    "everything that is NOT "Healthy""
    means.

  • steffensteffen Member Posts: 347 Maven
    "If I had been silent, I would have remained a philosopher" - my latin is worse than my ability to read texts in detail.

    I apologize ...
  • haddockhaddock Member Posts: 849 Maven
    Just joshin', friend, was it not old Seneca, he of the slit wrists who said...
    Aliquando et insanire iucundum est...
    ?
  • awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458 Unicorn
    Speaking as a newbie I can confirm utter madness when looking at some of the more esoteric Rapidminer operators.

    but I believe Seneca said

    "Nullum magnum ingenium sine mixtura dementiae fuit"
  • AxelAxel Member Posts: 19 Maven
    Hi haddock,

    that was exactly what I was looking for. I can only say:
    Plures gratiae pro vestri succurro

    Axel
Sign In or Register to comment.