"recreate exampleset after feature selection in javacode"
mw
New Altair Community Member
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
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
Tagged:
0
Answers
-
Hi Martine,
if you want to remove an attribute from a given example set, simply use this code:Attributes attributes = exampleSet.getAttributes();
Greetings,
Iterator<Attribute> iterator = attributes.iterator();
while(iterator.hasNext()) {
Attribute attribute = iterator.next();
if (matchesSomeCondition(attribute)) {
iterator.remove();
}
}
Sebastian0 -
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,
Sebastian0