## org.apache.mahout.df.node
Class MockLeaf

    java.lang.Object
      org.apache.mahout.df.node.Node
          org.apache.mahout.df.node.Leaf
              org.apache.mahout.df.node.MockLeaf

All Implemented Interfaces:
  org.apache.hadoop.io.Writable

    public class MockLeaf

extends Leaf

Custom Leaf node that returns for each instance its own label. Used mainly for testing purposes

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.mahout.df.node.Node
`Node.Type`

Constructor Summary
`MockLeaf()`

Method Summary
`int` `classify(Instance instance)` predicts the label for the instance
`protected java.lang.String` `getString()`
`protected Node.Type` `getType()`

Methods inherited from class org.apache.mahout.df.node.Leaf
`equals, hashCode, maxDepth, nbNodes, readFields, writeNode`

Methods inherited from class org.apache.mahout.df.node.Node
`read, toString, write`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### MockLeaf

    public MockLeaf()

Method Detail

### classify

    public int classify(Instance instance)

  Description copied from class: `Node`
  predicts the label for the instance

  Overrides:
    `classify` in class `Leaf`
  Returns:
    -1 if the label cannot be predicted

### getType

    protected Node.Type getType()

  Overrides:
    `getType` in class `Leaf`

### getString

    protected java.lang.String getString()

  Overrides:
    `getString` in class `Leaf`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.