mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yang Zhou <bingo.y...@gmail.com>
Subject Re: The function of the parameter complemented in DecisionTreeBuilder
Date Thu, 01 Nov 2012 15:20:05 GMT
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 <ancaleuca2005@gmail.com> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message