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

Linear regression using Encog

Now, we will quickly look at how Encog can be used to make a regression model. We will be using the dataset that we used in a previous section, Loading the data. The following steps show how to make the model: 

  1. To load the data, we will use the VersatileMLDataSet function, as follows:
File datafile = new File("data/ENB2012_data.csv");VersatileDataSource source = new CSVDataSource(datafile, true, CSVFormat.DECIMAL_POINT);VersatileMLDataSet data = new VersatileMLDataSet(source); data.defineSourceColumn("X1", 0, ColumnType.continuous); data.defineSourceColumn("X2", 1, ColumnType.continuous); data.defineSourceColumn("X3", 2, ColumnType.continuous); data.defineSourceColumn("X4", 3, ColumnType.continuous);data.defineSourceColumn("X5", ...
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