public final class DataFileIterator extends com.google.common.collect.AbstractIterator<Pair<PreferenceArray,long[]>> implements SkippingIterator<Pair<PreferenceArray,long[]>>, Closeable
An Iterator which iterates over any of the KDD Cup's rating files. These include the files
{train,test,validation}Idx{1,2}}.txt. See http://kddcup.yahoo.com/. Each element in the iteration corresponds
to one user's ratings as a PreferenceArray and corresponding timestamps as a parallel long
array.
Timestamps in the data set are relative to some unknown point in time, for anonymity. They are assumed to be relative to the epoch, time 0, or January 1 1970, for purposes here.
| Constructor and Description |
|---|
DataFileIterator(File dataFile) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected Pair<PreferenceArray,long[]> |
computeNext() |
void |
skip(int n) |
endOfData, hasNext, next, peekpublic DataFileIterator(File dataFile) throws IOException
IOExceptionprotected Pair<PreferenceArray,long[]> computeNext()
computeNext in class com.google.common.collect.AbstractIterator<Pair<PreferenceArray,long[]>>public void skip(int n)
skip in interface SkippingIterator<Pair<PreferenceArray,long[]>>public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2008–2013 The Apache Software Foundation. All rights reserved.