"Regular expression problem..."
Axel
New Altair Community Member
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
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
0
Answers
-
Hi there Axel,
I think you needed a bit more, like this...<operator name="Root" class="Process" expanded="yes">
Regex can turn normal humans to wobbly puddings, so I use RegexBuddy, and commend it to all but the most pointy-headed ascetics.
<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>
Pip Pip
( Exit Uncle Beastly stage left...)
0 -
This is madness
If the possible values are restricted to those mentioned by axel, then use this one:
regards,
disease.*
steffen0 -
Steffen, really!!
True enough. But that is not whatIf the possible values are restricted to those mentioned by axel, then use this one:
means."everything that is NOT "Healthy""
0 -
"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 ...0 -
Just joshin', friend, was it not old Seneca, he of the slit wrists who said...
?Aliquando et insanire iucundum est... 0 -
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"0 -
Hi haddock,
that was exactly what I was looking for. I can only say:
Plures gratiae pro vestri succurro
Axel
0