"Regular expression problem..."

Axel
Axel New Altair Community Member
edited November 2024 in Community Q&A
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:

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • haddock
    haddock New Altair Community Member
    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...)



  • steffen
    steffen New Altair Community Member
    This is madness  :o

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

    disease.*
    regards,

    steffen
  • haddock
    haddock New Altair Community Member
    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.

  • steffen
    steffen New Altair Community Member
    "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 ...
  • haddock
    haddock New Altair Community Member
    Just joshin', friend, was it not old Seneca, he of the slit wrists who said...
    Aliquando et insanire iucundum est...
    ?
  • Andrew2
    Andrew2 New Altair Community Member
    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"
  • Axel
    Axel New Altair Community Member
    Hi haddock,

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

    Axel

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.