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

Loading data from a file

Loading data from a file can be achieved with the FileDataModel class. We will be expecting a comma-delimited file, where each line contains a userID, an itemID, an optional preference value, and an optional timestamp, in the same order, as follows:

userID,itemID[,preference[,timestamp]] 

An optional preference accommodates applications with binary preference values, that is, the user either expresses a preference for an item or not, without a degree of preference; for example, with a like or dislike.

A line that begins with a hash (#) or an empty line will be ignored. It is also acceptable for the lines to contain additional fields, which will be ignored.

The DataModel class assumes the following types:

  • The userID ...
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