org.apache.mahout.fpm.pfpgrowth
Class TransactionTree
java.lang.Object
org.apache.mahout.fpm.pfpgrowth.TransactionTree
- All Implemented Interfaces:
- org.apache.hadoop.io.Writable
public final class TransactionTree
- extends java.lang.Object
- implements org.apache.hadoop.io.Writable
A compact representation of transactions modeled on the lines to
FPTree
This reduces plenty of space and speeds up
Map/Reduce of PFPGrowth
algorithm by reducing data size passed from the Mapper to the reducer where
FPGrowth
mining is done
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransactionTree
public TransactionTree()
TransactionTree
public TransactionTree(int size)
TransactionTree
public TransactionTree(java.lang.Integer[] items,
java.lang.Long support)
TransactionTree
public TransactionTree(java.util.List<Pair<java.util.List<java.lang.Integer>,java.lang.Long>> transactionSet)
addChild
public void addChild(int parentNodeId,
int childnodeId)
addCount
public boolean addCount(int nodeId,
long nextNodeCount)
addPattern
public int addPattern(java.util.List<java.lang.Integer> myList,
long addCount)
attribute
public int attribute(int nodeId)
childAtIndex
public int childAtIndex(int nodeId,
int index)
childCount
public int childCount()
childCount
public int childCount(int nodeId)
childWithAttribute
public int childWithAttribute(int nodeId,
int childAttribute)
count
public long count(int nodeId)
generateFList
public java.util.Map<java.lang.Integer,org.apache.commons.lang.mutable.MutableLong> generateFList()
getCompressedTree
public TransactionTree getCompressedTree()
getIterator
public java.util.Iterator<Pair<java.util.List<java.lang.Integer>,java.lang.Long>> getIterator()
isTreeEmpty
public boolean isTreeEmpty()
readFields
public void readFields(java.io.DataInput in)
throws java.io.IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
java.io.IOException
write
public void write(java.io.DataOutput out)
throws java.io.IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
java.io.IOException
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.