Skip to content

Instantly share code, notes, and snippets.

@kryton
Created July 8, 2015 22:07
Show Gist options
  • Save kryton/2d8d8b3ffe27052f6d28 to your computer and use it in GitHub Desktop.
Save kryton/2d8d8b3ffe27052f6d28 to your computer and use it in GitHub Desktop.
public class DL {
private static Logger log = LoggerFactory.getLogger(DL.class);
public static void main(String[] args) throws Exception {
int batchSize = 10;
File file = new File("/Users/iholsman/dl/data/out/deeplearning.1.csv");
//File file = new File("/Users/iholsman/dl/src/Canova/canova-api/src/test/resources/iris.libsvm");
FileSplit fileSplit = new FileSplit(file);
Configuration conf = new Configuration();
conf.set(FileRecordReader.APPEND_LABEL, "true");
RecordReader libSvmRecordReader = new LibSvmRecordReader();
libSvmRecordReader.initialize(conf, fileSplit);
DataSetIterator iter = new RecordReaderDataSetIterator(libSvmRecordReader, batchSize);
while (iter.hasNext()) {
DataSet d = iter.next();
log.info("Col Names - {}", d.getColumnNames());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment