🎉 🎉   RAPIDMINER 9.5 BETA IS OUT!!!   🎉 🎉

GRAB THE HOTTEST NEW BETA OF RAPIDMINER STUDIO, SERVER, AND RADOOP. LET US KNOW WHAT YOU THINK!

CLICK HERE TO DOWNLOAD

🦉 🎤   RapidMiner Wisdom 2020 - CALL FOR SPEAKERS   🦉 🎤

We are inviting all community members to submit proposals to speak at Wisdom 2020 in Boston.


Whether it's a cool RapidMiner trick or a use case implementation, we want to see what you have.
Form link is below and deadline for submissions is November 15. See you in Boston!

CLICK HERE TO GO TO ENTRY FORM

"recreate exampleset after feature selection in javacode"

mwmw Member Posts: 2 Contributor I
edited May 23 in Help
Hi all,

I can't find out how to rebuild or reduce my exampleset after feature selection in javacode, I've been trying for days. In Weka's AttributeSelection you can do that by using reduceDimensionality. My features are numeric and my classlabel is nominal. Before feature selection I have about 500 examples in my exampleset each represented by over a thousand attributes. Attribute selection reduces those thousand attributes to, say, 20 attributes. How can I represent the 500 examples in my exampleset represent with the 20 attributes in javacode?

Any suggestion will be much appreciated,

Martine

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,527   Unicorn
    Hi Martine,
    if you want to remove an attribute from a given example set, simply use this code:
    Attributes attributes = exampleSet.getAttributes();
    Iterator<Attribute> iterator = attributes.iterator();
    while(iterator.hasNext()) {
      Attribute attribute = iterator.next();
      if (matchesSomeCondition(attribute)) {
        iterator.remove();
      }
    }
    Greetings,
      Sebastian
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,527   Unicorn
    Hi,
    since I noticed your other post that you are still using RapidMiner 4.2, I must append, that I'm not sure if it works this way in this ancient version.

    Greetings,
      Sebastian
Sign In or Register to comment.