Extract range from discretize

felix_wfelix_w Member Posts: 61 Contributor II
edited December 2018 in Help

Dear Rapidminer Community, 

 

I have used discretize by frequency to get some equal sized bins which worked fine but now I would like to extract the ranges given through the operator and I don't know how to do this. 

 

E.g. I get this nominal value: "range4 [0.476 - infinite(the sign for it)]" or this: "range1 [-infinite sign - 0.133]"

 

What I would like to have is the range calculated by the operator in two seperate attributes. 0.476 should be in a seperate attribute as well as the "infinite sign". 

 

I tried to do this by using "cut" in generate attributes, which didn't work for me as the amount of characters varies and is not stable, as can be seen in the examples above. 

 

Does anybody know a solution for this?

 

In a further step I would then calculate "real" values out of these extracted nominal range pieces. 

 

Best regards

Felix

Best Answer

  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Solution Accepted

    That's almost certainly just a metadata propagation problem, you should be able to type the name of the attributes directly into the Replace operator and not worry about the preselected attribute names.  You can also try checking "Synchronize Meta Data with Real Data" under the Process menu (at the top) and it might resolve the issue.

     

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts

Answers

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager

    Hi @felix_w so if it were me, I would first use Split with a RegEx "\s[-]\s" which will split those ranges into two new attributes. Then I would use a Replace on those two new attributes using "range[0-9]+\s\[" for the first one, and "\]" for the second one.


    Scott

     

  • felix_wfelix_w Member Posts: 61 Contributor II

    Hi Scott, 

     

    first of all thank you for your help!

     

    I tried your solution and the split operator works but I have a problem with the output. If I try to use "replace", I can't select the output from "Split", it's simply not in the list? In the results view I can see that the newly generated attributes are there and in the Statistics tab I can see that the ouptput from split is also "nominal" but somehow I can't choose those newly generated attributes in the replace operator? How can I resolve this problem?

     

    Best regards

    Felix  

  • felix_wfelix_w Member Posts: 61 Contributor II

    I have solved the "replace" problem now by selecting "value_type" and nominal in the attribute filter type menu and got now two clean attributes but I still have the problem that other operator seem not to find those two attributes. I tried to rename them and still couldn't select them in the menu?

  • felix_wfelix_w Member Posts: 61 Contributor II

    Hi Brian, 

     

    you are right! I simply typed all the attributes in further operators and after having done a calculation the generated attribute was also selectable. I don't know if "synchronize metadata with real data" did any help but at least everything works now. ;-) 

     

    Thank you for your help!

     

    Best regards

    Felix

Sign In or Register to comment.