I read the code already, but still can not get a clear idea about it.
Complemented is true by default and it has an impact on how the tree
builder works.
The following is the code snippet from DecisionTreeBuilder.java
Collection<Double> subsetValues = null;
if (complemented) {
subsetValues = Sets.newHashSet();
for (double value : values) {
subsetValues.add(value);
}
values = fullSet.values(best.getAttr());
}
int cnt = 0;
Data[] subsets = new Data[values.length];
for (int index = 0; index < values.length; index++) {
if (complemented && !subsetValues.contains(values[index])) {
continue;
}
subsets[index] = data.subset(Condition.equals(best.getAttr(),
values[index]));
if (subsets[index].size() >= minSplitNum) {
cnt++;
}
}
On Thu, Nov 1, 2012 at 10:16 PM, Anca Leuca <[email protected]> wrote:
> Hi,
>
> If I call the method setComplemented(boolean complemented) with the
> > parameter True, how does this effect the tree builder? Thanks for the
> help!
> >
>
> The source<
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.mahout/mahout-core/0.7/org/apache/mahout/classifier/df/builder/DecisionTreeBuilder.java#DecisionTreeBuilder.0complemented
> >
> suggests
> that complemented is true by default so I guess it wouldn't?
>
> That being said, I don't know what complemented actually does, the code
> might be useful to look at, or maybe someone more knowledgeable than me
> could shed some light on this.
>
> Anca
>