I am changing to do feature selection for single label classification (e.g, with SMO) but It doesn't work so far.
Could anyone please show me proper setting of dimFeatureSelection for single label classification?
For your convenient, I address here the current setting for multi-label FS:
// multi-label feature selection (Mulan specific options), reduces the feature set to 10
Map<String, Object> dimFeatureSelection = new HashMap<String, Object>();
dimFeatureSelection.put(DIM_LABEL_TRANSFORMATION_METHOD,
"BinaryRelevanceAttributeEvaluator");
dimFeatureSelection.put(DIM_ATTRIBUTE_EVALUATOR_ARGS,
asList(new String[] { InfoGainAttributeEval.class.getName() }));
dimFeatureSelection.put(DIM_NUM_LABELS_TO_KEEP, 10);
dimFeatureSelection.put(DIM_APPLY_FEATURE_SELECTION, true);
Kind regards,
Thanks for the hint! Does this work for all single-label experiments?
I just tried to implement your code in one of my experiments, but since I am not using groovy, I had to translate it into regular Java code and I am not entirely sure, whether I did that correctly. (It had no effect on my experiment, in any case.)
// Filter only best Features
@SuppressWarnings("unchecked")
Map<String, Object> dimFeatureSelection = new HashMap<String, Object>();
dimFeatureSelection.put(
"featureSearcher",
Arrays.asList( new String[] {
Ranker.class.getName(),
"-N",
"20"
})
);
dimFeatureSelection.put(
"attributeEvaluator",
Arrays.asList( new String[] {
InfoGainAttributeEval.class.getName()
})
);
dimFeatureSelection.put("applySelection", new Boolean(true));
Afterwards, I added the dimension as a bundle to the parameterspace.