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] ...

Get Machine Learning in Java - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.