Skip to Content
Machine Learning in Java - Second Edition
book

Machine Learning in Java - Second Edition

by AshishSingh Bhatia, Bostjan Kaluza
November 2018
Intermediate to advanced
300 pages
7h 42m
English
Packt Publishing
Content preview from Machine Learning in Java - Second Edition

Importing from directory

Mallet supports reading from directory with the cc.mallet.pipe.iterator.FileIterator class. A file iterator is constructed with the following three parameters:

  • A list of File[] directories with text files
  • A file filter that specifies which files to select within a directory
  • A pattern that is applied to a filename to produce a class label

Consider the data structured into folders as shown in the following screenshot. We have documents organized in five topics by folders (tech, entertainment, politicssport, and business). Each folder contains documents on particular topics, as shown in the following screenshot:

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Java Machine Learning

Mastering Java Machine Learning

Uday Kamath, Krishna Choppella
Java: Data Science Made Easy

Java: Data Science Made Easy

Richard M. Reese, Jennifer L. Reese, Alexey Grigorev

Publisher Resources

ISBN: 9781788474399Supplemental Content