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

Classifying new data

Suppose that we record attributes for an animal whose label we do not know; we can predict its label from the learned classification model. We will use the following animal for this process:

First, we construct a feature vector describing the new specimen, as follows:

double[] vals = new double[data.numAttributes()]; vals[0] = 1.0; //hair {false, true} vals[1] = 0.0; //feathers {false, true} vals[2] = 0.0; //eggs {false, true} vals[3] = 1.0; //milk {false, true} vals[4] = 0.0; //airborne {false, true} vals[5] = 0.0; //aquatic {false, true} vals[6] = 0.0; //predator {false, true} vals[7] = 1.0; //toothed {false, true} vals[8] ...
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