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

Learning algorithms

We have loaded our data and selected the best features, and we are ready to learn some classification models. Let's begin with basic decision trees.

In Weka, a decision tree is implemented within the J48 class, which is a reimplementation of Quinlan's famous C4.5 decision tree learner (Quinlan, 1993).

We will make a decision tree by using the following steps:

  1. We initialize a new J48 decision tree learner. We can pass additional parameters with a string table—for instance, the tree pruning that controls the model complexity (refer to Chapter 1, Applied Machine Learning Quick Start). In our case, we will build an un-pruned tree; hence, we will pass a single -U parameter, as follows:
J48 tree = new J48(); String[] options ...
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