datafu.pig.stats
Class MarkovPairs
java.lang.Object
org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
datafu.pig.stats.MarkovPairs
public class MarkovPairs
- extends org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
Accepts a bag of tuples, with user supplied ordering, and generates pairs that can be used for
a Markov chain analysis. For example, if you had {(1), (4), (7)}, using the default lookahead of 1, you
get the pairs {
((1),(4)),
((4),(7))}
A lookahead factor tells the UDF how many steps in to the future to include. so, for a,b,c with a lookahead
of 2, a would be paired with both b and c.
The results are ordered are returned as ordered by the caller.
Fields inherited from class org.apache.pig.EvalFunc |
log, pigLogger, reporter, returnType |
Method Summary |
org.apache.pig.data.DataBag |
exec(org.apache.pig.data.Tuple input)
|
org.apache.pig.impl.logicalLayer.schema.Schema |
outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
|
Methods inherited from class org.apache.pig.EvalFunc |
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MarkovPairs
public MarkovPairs()
MarkovPairs
public MarkovPairs(java.lang.String lookahead_steps)
exec
public org.apache.pig.data.DataBag exec(org.apache.pig.data.Tuple input)
throws java.io.IOException
- Specified by:
exec
in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
- Throws:
java.io.IOException
outputSchema
public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
- Overrides:
outputSchema
in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
Matthew Hayes, Sam Shah