Tuesday, July 24, 2007

Selective Attribute for classification training

The easiest way to do this would be to first make a copy of the
Instances object (Instances copyt = new Instances(train)) holding your
training data. Then for each instance that has values that you don't
want to train on set them to "missing". I.e. assume i is an instance
and the value at attribute 3 is to be skipped when training naive
Bayes, then i.setMissing(2) would do the trick. Note, that this
approach is specific to the way that naive Bayes works.

No comments: